Why rearrange?

gorb at krasu.ru gorb at krasu.ru
Tue Dec 4 09:03:01 CET 2001


        symbol x("x");
        symbol y("y");
        symbol a("a");
        symbol z("z");
        ex e1=a-y+x+z;
        ex e2=a+x-y+z;
        cout <<"e1="<< e1 << endl;
	// e1=a-y+z+x
        cout <<"e2="<< e2 << endl;
	// e2=a-y+z+x

What if I want to get the same order of the variables which was in
expression on creation. How can I do this?
And how can I even get
	ex e3=x+x;
        cout <<"e3="<< e3 << endl;
	// e3=x+x
?


best regards,
Dmitri Gorbenko



More information about the GiNaC-list mailing list