[GiNaC-list] array expressions with symbolic index

Chris Dams Chris.Dams at mi.infn.it
Wed Jan 31 15:08:11 CET 2007


Dear Zhongxing Xu,

On Wed, 31 Jan 2007, Zhongxing Xu wrote:

> Is there something like array expression in GiNaC?
>
> [...]
>
> x = mem[2] + 2;
> y = mem[i] -3;
> x >= 3;
> Can GiNaC represent these expressions?
> Note that array index might be a symbolic value.

It depends what kind of properties and automatic simplifications you want.  
If you simply want to type expressions of the form mem[something],
defining your own symbolic function may already be sufficient. If you need
more than that, you might have to define your own class that derives from
the type basic.

GiNaC can already represent expressions like x>=3.

Good luck,
Chris



More information about the GiNaC-list mailing list