[Numpy-discussion] A bug in scipy.linalg.lu_factor?
Nils Wagner
nwagner at iam.uni-stuttgart.de
Thu Jan 25 12:46:03 CST 2007
On Thu, 25 Jan 2007 16:06:23 -0200
"Paulo J. S. Silva" <pjssilva at ime.usp.br> wrote:
> Hello,
>
> I am trying to write some unit tests to my new
>"Automatic matrix" code
> and I think I bumped into a bug in
>scipy.linalg.lu_factor. If you give a
> matrix to it, it doesn't honor the overwrite_a option:
>
> In [1]:import numpy as num
>
> In [2]:M = num.mat(
)
>
> In [3]:print M
> [[ 0.33267781 0.2100424 ]
> [ 0.61852696 0.32244386]]
>
> In [4]:import scipy.linalg as la
>
> In [5]:LU, P = la.lu_factor(M, overwrite_a=0); print M
> [[ 0.33267781 0.63136882]
> [ 0.61852696 -0.06807478]]
>
> In [6]:LU, P = la.lu_factor(M, overwrite_a=0); print M
> [[ 0.63136882 0.52691517]
> [-0.06807478 0.6543966 ]]
>
> As you can see the matrix is changed by calling the
>function.
>
> can anyone confirm this? I am running numpy 1.0.1 and
>scipy 0.5.2.
>
> Best,
>
> Paulo
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
It works if you use
M=num.random.rand(2,2)
Nils
I have filed a ticket.
More information about the Numpy-discussion
mailing list