[GiNaC-list] Symbol/Constant Ordering

Freddie Witherden freddie at witherden.org
Thu Dec 11 00:55:38 CET 2008


I am wondering how one might go about changing the order in which  
variables appear in an expression. E.g. if one had: symbol x("x"),  
y("y"), z("z"); ex myExpr = x * y * z * Pi; cout << myExpr; currently  
yields x*y*Pi*z.

If, for instance, I wanted Pi * x * y * z, how would I go about this?  
While the documentation speaks about ordering of vectors/maps using  
ex_is_less and a mention that it is used internally by GiNaC it does  
not (as far as I can tell) explain how to do it for expressions. (Is  
it possible to get it as a vector, which could then be sorted using a  
custom function?)

Regards, Freddie.

More information about the GiNaC-list mailing list