[SciPy-dev] scipy.sparse.linalg segfaults for complex data

Jake VanderPlas jakevdp at gmail.com
Thu Dec 10 14:07:03 EST 2009


> On Wed, Dec 9, 2009 at 7:05 PM, Jake VanderPlas <jakevdp at gmail.com> wrote:
>> Hello,
>> I just opened a ticket for this problem (#1067), but I'd like to get
>> this out to the list. ?I've found that the iterative solvers in
>> scipy.sparse.linalg produce Segmentation Faults for complex inputs.
>> Below is a simple example (for scipy v0.7.1). ?Should these functions
>> support complex data? ?If not, does anyone know a good way to solve
>> general linear systems for complex input? ?I say general because I
>> don't actually have a matrix per se, but a LinearOperator which
>> implements its matvec method using scipy.fftpack.
>> Thanks
>> ? Jake
>>
>>
>> import numpy as np
>> from scipy.sparse.linalg import cg
>>
>> N = 2
>> M = np.random.random((N,N)) + 1j*np.random.random((N,N))
>> v = np.random.random(N)
>> cg(M,v) ?#segmentation fault is here
>
> no problems here (WindowsXP, no umfpack)
>
>>>> N=2
>>>> M = np.random.random((N,N)) + 1j*np.random.random((N,N))
>>>> v = np.random.random(N)
>>>> import scipy.sparse.linalg as sla
>>>> sla.cg(M,v)
> (array([ 0.26265867+0.61820443j,  1.48541897-2.13027697j]), 20)
>
>>>> scipy.version.version
> '0.8.0.dev6118'
>>>> np.version.version
> '1.4.0rc1'
>
> Josef
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>>

I'm on a 64-bit Linux machine, running redhat 5
>>> scipy.__version__
'0.7.1'
>>> numpy.__version__
'1.3.0'
Just as a check, I tested this on our old 32 bit installation, and it
seems to work fine.  Could it be a 64 vs 32 bit problem?
  -Jake



More information about the SciPy-Dev mailing list