[GiNaC-list] BUG or incoherence: matrix A; A*pow(A,-1) =! 1

jros jros at unavarra.es
Wed Sep 16 16:46:34 CEST 2009


Hi,

We now that for matrix class objects A, GiNaC simplifies 

matrix A;
cout << A-A << endl;

give 0

The same way that 

symbol a
cout << a-a << endl;

gives 0

But I think that for coherence

matrix A;
cout << A*pow(A,-1) << endl;

should give 1, (I mean reduced to numeric(1) regardless the particular
form of A, or at least if it is square)

the  same way as

symbol a
cout << a*pow(a,-1) << endl;

is 1

By the way it would be wonderful if A-A give matrix-es instead of
numeric-s, although I think you've already had long discussions about
that.

Thank you,

Javier
PD: I wouldn't mind to derive a class from matrix to change this
behavior the easy way, but I don't know if this can be done this way.
Any light in this direction would be appreciated.





More information about the GiNaC-list mailing list