|
Boost : |
Subject: Re: [boost] [math] Does any one interesting in calculating derivative for a expression automatically?
From: Dongfei Yin (yin.dongfei_at_[hidden])
Date: 2009-03-06 06:30:21
Hi Joel,
I it is easy to map it onto d<N>(f,v), but I think it is difficult
to be optimized for N=1, 2, 3 ...
because to calculate the derivative of d<5>(f,v), actually, d<1>, d<2>
... d<5> will be calculated . but after
each derivative is calculated, it will be simplified before next step.
now the result of derivative expression can be saved as a functor,
so d(d(x*x,x),x), y = d(x*x,x); d(y,x);
is one of my purpose.
I will implement d<N>(...), that is a good idea and convenience,
thank you.
Dongfei.
> Can't this be mapped onto a d<N>(f,v) function that is optimized for N =
> 1,2,3,... ?
> I bet that if you use proto, matching d(d(d( ... )))) and repalcing by
> d<N>(...) should be easy.
>
> Do you perform your derivation recursively on the derivative degree (ie
> d(d(x*x,x),x) is y = d(x*x,x); d(y,x);)
> If yes, you may want to use coarser grain. Let's say you specialized d()
> d<2>() and d<3>() for ex. Computing d<5>
> is d<2>(d<3>()) instead of d(d(d(d(d()))). Of course, using d,d2, d4 is
> maybe a better option so you cna use bit representaiton of derivative
> degree to find how to combine the derivative.
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk