[GiNaC-list] Bug with matrix subtraction
ondrej at certik.cz
Sun Mar 25 21:58:15 CEST 2007
Hi, I am a co-developer of swiginac. The bug is probably there. But, exactly as
Alexei said, A-A = 0 is ugly, but, but fixing it would be very
difficult (if possible at all). That's why I decided to rewrite the
whole GiNaC in python directly:
And in SymPy, you can do:
In : m = Matrix(2,2,[x,0,0,0])
In : m
In : m-m
In : m+(-m)
On 3/22/07, Martin Sandve Alnæs <martinal at simula.no> wrote:
> 2007/3/22, Sheplyakov Alexei <varg at theor.jinr.ru>:
> > Hello!
> > On Thu, Mar 22, 2007 at 09:44:03AM +0100, Martin Sandve Alnæs wrote:
> > > If I subtract two equal matrices, I get the scalar 0.
> > In GiNaC (A-A) is always transformed into 0 (number). I admit this is
> > ugly, but fixing it would be very difficult (if possible at all).
> I see.
> > > If I do a+(-b) instead of a-b, I get a zero matrix as wanted.
> > Interesting. I get zero (a number) in both ways:
> Seems like the matrix with zeros only happens when using the swiginac
> bindings, so techniqually the bug is there.
> Thanks for the quick response, anyway.
> GiNaC-list mailing list
> GiNaC-list at ginac.de
More information about the GiNaC-list