Possible bug in LinearAlgebra module
Hi, I have been working with the function (implmenting the Moore-Penrose generalized inverse) : generalized_inverse of the module LinearAlgebra. It seems to present a bug when operating on matrices of complex numbers. I want someone to confirm this point before submitting the source. Thanks in advance, Aureli ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail:aureli@ipk.fhg.de fon: +49 30 39 00 61 50 fax: +49 30 39 17 517 #################################
I have been working with the function (implmenting the Moore-Penrose generalized inverse) :
generalized_inverse
of the module LinearAlgebra. It seems to present a bug when operating on matrices of complex numbers.
That is well possible. I use this function a lot but always on real matrices. I am not sure I even tested it on complex matrices when I wrote it ages ago. If you have a fix, it is certainly appreciated. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen@cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais -------------------------------------------------------------------------------
Aureli Soria Frisch writes:
I have been working with the function (implmenting the Moore-Penrose generalized inverse) : of the module LinearAlgebra. It seems to present a bug when operating on matrices of complex numbers.
This may or may not be related, but there are definitely problems with arrays of complex numbers sometimes being unneccessarily promoted to type "Object" - for example: Python 2.0b1 (#2, Sep 8 2000, 12:10:17) [GCC 2.95.2 19991024 (release)] on linux2 Type "copyright", "credits" or "license" for more information.
from Numeric import * a = array([1,2,3], Complex) a array([ 1.+0.j, 2.+0.j, 3.+0.j]) a % 2.0 array([(1+0j) , 0j , (1+0j) ],'O')
And we also know that there are a lot of problems with arrays of type "Object". So it's possible that somehow your Complex array is getting promoted to "Object" and running against a problem there. Just a guess, -cgw
This may or may not be related, but there are definitely problems with arrays of complex numbers sometimes being unneccessarily promoted to type "Object" - for example:
Interesting. I have been fighting against a strangely version-dependent bug in which similar unwanted promotions to Object arrays occur when ufuncs are called, and now I wonder if there is any relation. I have tried a few times to track this down, but the code is so, well, complicated that I never get far enough before I run out of time.
And we also know that there are a lot of problems with arrays of type "Object". So it's possible that somehow your Complex array is getting promoted to "Object" and running against a problem there.
LinearAlgebra certainly doesn't (and won't) work for Object arrays; it can handle only the data types supported by LAPACK. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen@cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais -------------------------------------------------------------------------------
participants (4)
-
Aureli Soria Frisch
-
Charles G Waldman
-
hinsen@dirac.cnrs-orleans.fr
-
Konrad Hinsen