[SciPy-user] Problems with linalg.logm

Pearu Peterson pearu at scipy.org
Wed Sep 24 15:42:48 EDT 2003


On Wed, 24 Sep 2003, Nils Wagner wrote:

> I tried to do something with linalg.logm 
> I have enclosed the program. 
>  
> Result may be inaccurate, approximate err = 1.32516030853e-09 
> Traceback (most recent call last): 
>   File "logm-test.py", line 36, in ? 
>     P1 = P1 + 
> (linalg.logm(z1*identity(7)-A)-linalg.logm(z0*identity(7)-A))/(2*pi*sqrt(-1.)) 
>   File "/usr/lib/python2.2/site-packages/scipy/linalg/matfuncs.py", line 225, in 
> logm 
>     F -= temp.T 
>   File "/usr/lib/python2.2/site-packages/Numeric/UserArray.py", line 58, in 
> __isub__ 
>     subtract(self.array, other, self.array) 
> TypeError: return array has incorrect type 
>  
> What is the reason for that ? 

The problem was in logm code where F was changed from complex to real 
matrix but temp was complex, this triggered the error when subtracting 
real matrix with complex matrix in situ. Hmm, so in situ operations
cannot change the objects type.
Anyway, the issue is resolved in CVS.

Pearu





More information about the SciPy-User mailing list