automatic differentiation and change expression ordering
Christian.Bauer at Uni-Mainz.DE
Thu Nov 20 15:57:46 CET 2003
On Wed, Nov 05, 2003 at 09:47:48PM +0200, Andrius Kurtinaitis wrote:
> int main()
> symbol r("r");
> ex der1 = mul( diff( intensity(r), r ), r ).hold();
Don't use hold() here.
> ex deriv = der1.diff(r);
> cout << deriv << endl;
> return 0;
> I get the following output:
> But I would like to get something like this:
> D( D(intensity)(r)*r )(r)
> Is it possible with ginac?
No. fderivative can only represent derivatives of symbolic functions, not
of general expressions.
> 2. What is the simplest way to change the order in multiplication so
> that the differential operators print after all other terms:
> instead of
You'd have to rewrite the output routine of the 'mul' class to rearrange
the terms. This is possible in GiNaC 1.2 without modifying GiNaC itself,
but it is not a trivial task.
> Is there maybe some work done to output fderivative in latex style?
Suggestions are welcome. :)
/ Physics is an algorithm
More information about the GiNaC-list