[GiNaC-list] [[1]]!=1 ??

Javier Ros Ganuza jros at unavarra.es
Fri Mar 17 19:52:15 CET 2006


I suppose that it is a feature...

 (matrix(3,1,lst(0,0,1)).transpose()*matrix(3,1,lst(0,0,1))).evalm()

gives a 1,1 matrix [[1]].

To convert it to a number or to a expression not containing a matrix, I
have to take directly the 0,0 element of the matrix.

Is there a more direct method?

If not I'm facing errors like (in ginsh notation)

> a=[[0,0,1]]*[[0],[0],[1]];
> a=evalm(a);
[[1]]
> 1+cos(a);
add::eval(): sum of non-commutative objects has non-zero numeric term


Thank you

Javier Ros



More information about the GiNaC-list mailing list