[SciPy-dev] problem with linalg.cholesky?

Andrew Jaffe a.h.jaffe at gmail.com
Mon Nov 28 15:31:05 CST 2005


Nils Wagner wrote:
> On Mon, 28 Nov 2005 19:37:53 +0000
>   Andrew Jaffe <a.h.jaffe at gmail.com> wrote:
>>
>>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  
>>cholesky_decomposition
>>    results = lapack_routine('L', n, a, m, 0)
>>lapack_lite.LapackError: Parameter a is not contiguous 
>>in lapack_lite.dpotrf
>>------------------------------------------------------------
>>
>>(The cholesky decomposition in this case should just be 
>>the matrix itself; the same error occurs with a complex matrix.)

But Nils W got:
> 
> Scipy version:  0.7.1.1530
> identity matrix:
> [[ 1.  0.  0.  0.]
>   [ 0.  1.  0.  0.]
>   [ 0.  0.  1.  0.]
>   [ 0.  0.  0.  1.]]
> about to get cholesky decomposition
> [[ 1.  0.  0.  0.]
>   [ 0.  1.  0.  0.]
>   [ 0.  0.  1.  0.]
>   [ 0.  0.  0.  1.]]

Hmmmm, I *still* get the error with 0.7.1.1534.
So it must be specific to OS X... Anyone else out there see this?

Andrew




More information about the Scipy-dev mailing list