On Mon, Oct 03, 2005 at 12:49:18PM -0400, Alan Bromborsky wrote:
Consider the statements:
lst test;
test = x+2*y,A*z-B*pow(z,2),x+y+z;
There is a problem here due to the "," in "pow(z,2)" which cases the list elements to be separated incorrectly.
This program: #include <iostream> #include <stdexcept> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { symbol x("x"); symbol y("y"); symbol z("z"); symbol A("A"); symbol B("B"); lst test; test = x+2*y, A*z-B*pow(z,2), x+y+z; cout << test << endl; return 0; } prints {2*y+x,A*z-z^2*B,z+y+x} This is exactly what I expect, (the comma in `pow(z,2)' separates function arguments, it has nothing to do with (overloaded) operator,), so I can't see any problems here. Could you please be more specific -- what do you expect and what actually happens? -- All science is either physics or stamp collecting.