[GiNaC-list] array expressions with symbolic index

Sheplyakov Alexei varg at theor.jinr.ru
Wed Jan 31 17:53:14 CET 2007


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20070131/1114fc2b/attachment.pgp


More information about the GiNaC-list mailing list