11 Dec
2008
11 Dec
'08
12:55 a.m.
Hi, 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.