[GiNaC-list] list input

Richard B. Kreckel kreckel at in.terlu.de
Sun Mar 1 13:07:15 CET 2015


On 03/01/2015 12:25 PM, soppon wrote:
> #include <iostream>
> #include <ginac/ginac.h>
> using namespace std;
> using namespace GiNaC;
> 
> int main()
> {
>     symbol xs("x");
>     lst expr;
>     parser reader;
>     expr=reader("{x,x}");
>     cout <<"list " << expr  << endl;
>     cout <<"number of elements "<< expr.nops() << endl;
>     cout <<"1st el " <<expr[0] << endl;
>     cout <<"2nd el, error " <<expr[1]<< endl;
>     return 0;
> }

Your list expr has only one element, which is itself a list with two
elements.

best wishes
   -richy.
-- 
Richard B. Kreckel
<http://in.terlu.de/~kreckel/>


More information about the GiNaC-list mailing list