Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2002-02-12 13:58:03


Dear Mathias,

On Tuesday 12 February 2002 19:54, this_one_was_not_taken wrote:

> I like the idea of having such a library. It is probably
> to some extent the same as programming a polynom class,
> that has polynoms up to a fixed order??! E.g.:
>
> ( f(0) + f'(0) * x ) * ( g(0) + g'(0) x )
> = ( f(0) + g(0) ) + ( f'(0) * g(0) + g'(0) * f(0) ) * x + O(x^2)
>
> Ok, there are some constant prefactors for higher derivatives,
> but otherwise, it looks very much the same. Perhaps it would make
> sense to base the library on a polynom class. I once used something
> like:
>
> typedef polynom<int,'x',4> polynom_type;
> typedef polynom_type::symbol_type symbol_type;
>
> polynom_type p, q, r;
> symbol_type x;
[...]

Well it's similar to a polynom class that truncates the higher orders,
but you have to obey the chain rule,
e.g. in f( g(x) )' = f'(y)*g'(x) at y=g(x).
Note that in this case f' is calculated at a different point y, than g.

Using a polynom class you would expand around a fixed x_0.

Best wishes
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk