[GiNaC-list] How can I build an expression one character at a time?

Richard B. Kreckel kreckel at ginac.de
Tue Jan 8 22:30:10 CET 2013

On 01/07/2013 05:12 AM, Roger Gordon wrote:
> Hi guys, I recently started using ginac, and one thing I couldnt figure
> out from the tutorial is how can I make an expression one piece at a
> time. So if I wanted to build an expresison out of a list like x,=,5,*,4
> I imagine doing something like
> ex expr;
> expr.append(x);
> expr.append(==);
> expr.append(5);
> expr.append(4);
> I understand the numbers are numerics, and x would be a symbol, but I
> dont know what the operators would be ( * / + - ).
> Does anyone how I can do this?

You can't do that with GiNaC.

>  Does this even make any sense to you?

Not really: Between any two calls to ex::append(), your object would be 
in an utterly undead state. This isn't supported.

Richard B. Kreckel

More information about the GiNaC-list mailing list