[GiNaC-list] Given a formal iterated derivative (GiNaC::fderivative), what actually is it?
Richard B. Kreckel
kreckel at in.terlu.de
Sat Apr 9 23:59:36 CEST 2016
Hi,
On 04/07/2016 05:30 PM, Ricardo Buring wrote:
> Using GiNaC one can define a symbolic/formal function f of two variables
> as follows:
>
> DECLARE_FUNCTION_2P(f)
> REGISTER_FUNCTION(f, dummy())
>
> Formal derivatives can be computed by defining symbols x, y and
> calculating e.g.
>
> f(x,y).diff(x, 3).diff(y, 2)
>
> which is printed as
>
> D[0,0,0,1,1](f)(x,y)
>
> This is fantastic.
Hmmm...
Wouldn't it be more fantastic if it were printed D[x,x,x,y,y](f)(x,y)?
> Now, I would like to obtain the list [0, 0, 0, 1, 1]
> from the above expression.
> Checking the printing code GiNaC::fderivative::do_print, this is stored
> in a GiNaC::paramset.
> However, it's protected, and it doesn't seem to be accessible by any
> method. My attempt
>
> if (is_a<fderivative>(e))
> {
> fderivative fder = ex_to<fderivative>(e);
> for (auto x : fder.parameter_set)
> cout << x << ", ";
> }
>
> therefore fails. Could an accessor or some such be implemented so this
> (basic) operation becomes possible?
Sure. But what are you really trying to accomplish? (I'm asking because
I want to find a rather general solution.)
-richy.
--
Richard B. Kreckel
<http://in.terlu.de/~kreckel/>
More information about the GiNaC-list
mailing list