Hi! On Wed, Jan 31, 2007 at 10:16:56PM +0800, Zhongxing Xu wrote:
Is there something like array expression in GiNaC?
Could you elaborate, please? What is exactly "array expression"?
For example: x = mem[2] + 2; y = mem[i] -3; Can GiNaC represent these expressions? Note that array index might be a symbolic value.
GiNaC supports associative arrays with expressions as keys, i.e. symbol x("x"), y("y"), z("z"); exmap m; // nothing really magic: std::map<ex, ex, ex_is_less> m[z] = 2*x + y; m[1] = sin(y);
x >= 3;
Syntactically, this is correct GiNaC code. It creates object of the GiNaC::relational type. But I wonder what is _your_ interpretation...
After checking out the reference manual of GiNaC, I guess class idx and varidx and indexed() is the thing for me. Is it right?
I don't think so. Best regards, Alexei -- All science is either physics or stamp collecting.