[GiNaC-list] multi index storage of expressions

Chris Dams Chris.Dams at mi.infn.it
Tue Feb 20 20:04:13 CET 2007


Dear Charlls,

On Sun, 18 Feb 2007, Charlls Quarra wrote:

> I wanted to define a simple matrix of derivatives
> (i.e: a Jacobian) first as an indexed object:

Why don't you simply invent a nice name for your multi-index object (say 
"M") and store the values of them in an exmap. As in 
exmap m;
m[indexed(M, idx(1,3), idx(2,3), idx(3,3))] = value_of_entry_1_2_3;
After you have filled your exmap with all the indices you like, you can 
use the exmap in a call to .subs to replace tensor objects with numerical 
indices bij the appropriate value.

Does this help?
Chris



More information about the GiNaC-list mailing list