[GiNaC-list] write access to entries of submatrices [Was: multi index storage of expressions]

Sheplyakov Alexei varg at theor.jinr.ru
Tue Feb 20 07:58:56 CET 2007

On Mon, Feb 19, 2007 at 11:38:20PM -0300, Charlls Quarra wrote:

> ok i found that this awfully-looking hack does the
> job:
> ( *(matrix*) & ex_to<matrix>(foo(0,1)) )(1,1) = 34;

Ugh, this is plain EVIL.

> im eager to find out what its the ginac-sanctioned way
> to do it though

As I explained in the previous mail, there is no way to assign anything
to references returned by ex_to<T>. If you really need multidimensional
arrays (and vector<matrix> or vector<vector<vector <ex> > > are not
good enough) then GiNaC is not proper tool for your task.

Best regards,

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/20070220/f2cd6447/attachment-0001.pgp

More information about the GiNaC-list mailing list