[GiNaC-list] list input

soppon gvitbsord at aol.com
Sun Mar 1 13:34:11 CET 2015


On 03/01/2015 07:14 AM, Vladimir V. Kisil wrote:
>>>>>> On Sun, 01 Mar 2015 13:07:15 +0100, "Richard B. Kreckel" <kreckel at in.terlu.de> said:
>      RK> 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; }
>
>      RK> Your list expr has only one element, which is itself a list with
>      RK> two elements.
>      
>      As was already suggested, a plain list may be obtained by:
>
>      expr=ex_to<lst>(reader("{x,x}"));
Thanks a lot for casting.
Have a nice day.


More information about the GiNaC-list mailing list