[SciPy-dev] problem with linalg.cholesky?

Andrew Jaffe a.h.jaffe at gmail.com
Mon Nov 28 13:37:53 CST 2005

hi all,

(apologies that a similar question has appeared elsewhere...)

In the newest incarnation of scipy_core, I am having trouble with the
cholesky(a) routine. Here is some minimal code reproducing the bug  
(on OS X)

from scipy import identity, __core_version__, Float64
import scipy.linalg as la
print 'Scipy version: ', __core_version__
i = identity(4, Float64)
print 'identity matrix:'
print i

print 'about to get cholesky decomposition'
c = la.cholesky(i)
print c

which gives

Scipy version:  0.6.1
identity matrix:
[[ 1.  0.  0.  0.]
  [ 0.  1.  0.  0.]
  [ 0.  0.  1.  0.]
  [ 0.  0.  0.  1.]]
about to get cholesky decomposition
Traceback (most recent call last):
   File "/Users/jaffe/Desktop/bad_cholesky.py", line 13, in ?
     c = la.cholesky(i)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/linalg/basic_lite.py", line 117, in  
     results = lapack_routine('L', n, a, m, 0)
lapack_lite.LapackError: Parameter a is not contiguous in  

(The cholesky decomposition in this case should just be the matrix  
itself; the same error occurs with a complex matrix.)

Any ideas? Could this have anything to do with _CastCopyAndtranspose  
in Basic_lite.py? (Since there are few other candidates for anything  
that actually changes the matrix.)

Thanks in advance,


Andrew Jaffe                                    a.jaffe at imperial.ac.uk
Astrophysics Group                                    +44 207 594-7526
Blackett Laboratory, Room 1013                    FAX             7541
Imperial College, Prince Consort Road
London SW7 2AZ ENGLAND              http://astro.imperial.ac.uk/~jaffe

More information about the Scipy-dev mailing list