22 Mar
2007
22 Mar
'07
9:44 a.m.
If I subtract two equal matrices, I get the scalar 0. This messes up later calculations, since a scalar doesn't have op(i), transpose(), etc. If I do a+(-b) instead of a-b, I get a zero matrix as wanted. Note that the code is in Python using the swiginac bindings, which now calls evalm() automatically between operations. In [32]: m = matrix(2,2,[x,0,0,0]) In [33]: m-m Out[33]: 0 In [34]: m+(-m) Out[34]: [[0,0],[0,0]] So we have the silly relation that "a-b != a+(-b)", which can only be called a bug. -- --- Martin Sandve Alnæs PhD student, Cardiac Computations Simula Research Laboratory, Norway