[Matrix-SIG] Bug in matrixmultiply
Robin Becker
robin@jessikat.demon.co.uk
Fri, 15 Oct 1999 11:27:02 +0100
In article <Pine.LNX.4.10.9910151038320.4104-100000@laplace>, Mikkel
Bollinger <mbolling@fysik.dtu.dk> writes
>I have been using the NumPy-package and I believe I found a bug using
>the function "matrixmultiply":
>
>>>> c=asarray([[0,1,0],[0,0,0],[0,0,0]])
>>>> matrixmultiply(5,c)
>array([[0, 0, 0],
> [5, 0, 0],
> [0, 0, 0]])
>
>and
>
>>>> matrixmultiply(c,5)
>array([[0, 5, 0],
> [0, 0, 0],
> [0, 0, 0]])
>
>When multiplying with a constant, matrixmultiply should either raise an
>error message or interpret "5" as 5*unitmatrix. However it should not
>transpose the output matrix as is the case for matrixmultiply(5,c).
>Regards,
>Mikkel Bollinger
>
yes I agree. Interestingly
>>> c*5
array([[0, 5, 0],
[0, 0, 0],
[0, 0, 0]])
>>> 5*c
array([[0, 5, 0],
[0, 0, 0],
[0, 0, 0]])
>>>
--
Robin Becker