[SciPy-dev] problem with linalg.cholesky?
Jeff Whitaker
jswhit at fastmail.fm
Fri Dec 2 15:58:49 CST 2005
Andrew Jaffe wrote:
>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
>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.)
>
>
>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,
>
>A
>
>
>
Another data point - on OS X 10.3.9 with python 2.4.2, scipy_core 0.6.1
and scipy 0.4.3 I get the expected result (no error).
-Jeff
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker at noaa.gov
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
More information about the Scipy-dev
mailing list