1 Mar
2015
1 Mar
'15
1:07 p.m.
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/>