[SciPy-User] lstsq error under Windows?
Agile Aspect
agile.aspect at gmail.com
Wed May 5 14:49:16 EDT 2010
On Tue, May 4, 2010 at 12:48 PM, <bruce.labitt at autoliv.com> wrote:
> I have found an issue with scipy.linalg.lstsq, I think. The following
> code works in Ubuntu 10.04 x86-64, but not in WinXP-32. I think it should
> work in WinXP. Here is a minimum example:
>
> """==== program testlstsq.py ======================"""
> from scipy.linalg import eig, lstsq
> from numpy import angle, zeros, pi, arcsin
>
> A = zeros((4,1), dtype='complex')
> B = zeros((4,1), dtype='complex')
>
> A[0,0] = -0.535412460549-2.65798938848e-17j
> A[1,0] = -0.369432866546-0.131765700574j
> A[2,0] = -0.222906796932-0.263237285725j
> A[3,0] = -0.069087096386-0.38609560454j
>
> B[0,0] = -0.369432866546-0.131765700574j
> B[1,0] = -0.222906796932-0.263237285725j
> B[2,0] = -0.069087096386-0.38609560454j
> B[3,0] = 0.0882283631514-0.528093039953j
>
> try:
> print 'Got here'
> phi = lstsq(A,B)
> print 'Finished lstsq'
> except:
> print 'Exception Occurred'
> else:
> for a in range(len(phi)):
> print 'phi[',a,']=',phi[a]
>
> w = -angle( eig(phi[0])[0][:] )
> d = 0.5
> aa = arcsin( w / (2.0*pi) )*180./pi # in degrees
> print 'aa unsorted =', aa
> """ ==== end of testlstsq.py =========================="""
>
On Ubuntu, what version of ALTAS is being used?
If I modify the 'except' to read
print 'Exception Occurred', sys.exc_info()[0]
the above code generates the enclosed error on CentOS 5 and Fedora 9
running python 2.5 and python 2.6, respectively, and both using
scipy-0.71 and nump 1.30.
Both plaforms use the same version of ATLAS, namely 3.8.2.
All software was built from source on the respective platforms.
Traceback (most recent call last):
File "./lstsq.py", line 22, in <module>
phi = lstsq(A,B)
File "/usr/devtools/lib/python2.6/site-packages/scipy/linalg/basic.py",
line 549, in lstsq
overwrite_b = overwrite_b)
ValueError: On entry to ZGELSS parameter number 12 had an illegal value
--
Enjoy global warming while it lasts.
More information about the SciPy-User
mailing list