[SciPy-user] spsolve not working

Andrew Corrigan acorriga@gmu....
Sun Mar 18 08:38:02 CDT 2007


I have the same problem mentioned below with scipy 0.5.2.  I try to call 
spsolve and get an error message.  This only happens when running in 
64-bit Ubuntu, but doesn't happen in Windows XP with Enthought's 
Python.  Can someone please help?

Thanks,
Andrew

Traceback (most recent call last):

  File 
"/home/acorrigan/workspace/meshless/src/physics/potential/test1.py", 
line 75, in ?
    main()
  File 
"/home/acorrigan/workspace/meshless/src/physics/potential/test1.py", 
line 69, in main
    s_f = GeneralizedRBFInterpolant(points, values, operators, 
RadialKernel(ArbitrarySupport(Gaussian(1.0),1.0)), FixedGrid)
  File 
"/home/acorrigan/workspace/meshless/src/interpolation/interpolant/generalized_rbf.py", 
line 55, in __init__
    self.resolve(values)
  File 
"/home/acorrigan/workspace/meshless/src/interpolation/interpolant/generalized_rbf.py", 
line 64, in resolve
    self.coefficients = linsolve.spsolve(self.A, 
values.swapaxes(0,1)).swapaxes(0,1)     #.tocsr()
  File "/usr/lib/python2.4/site-packages/scipy/linsolve/linsolve.py", 
line 77, in spsolve
    mat, csc = _toCS_superLU( A )
  File "/usr/lib/python2.4/site-packages/scipy/linsolve/linsolve.py", 
line 24, in _toCS_superLU
    mat = A.tocsc()
  File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 
2684, in tocsc
    return self.tocsr(nzmax).tocsc()
  File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 
2673, in tocsr
    data[k : k+len(row)] = self.data[i]
ValueError: setting an array element with a sequence.









Nils Wagner <nwagner <at> iam.uni-stuttgart.de> writes:

 >
 > Hi all,
 >
 > I would like to solve
 >
 > K_dyn x = f,
 >
 > where K_dyn is a sparse matrix.  UMFPACK is not installed and I am using
 > the latest svn version.
 >
 > >>> K_dyn
 > <71987x71987 sparse matrix of type '<type 'numpy.float64'>'
 >         with 3083884 stored elements (space for 3083884)
 >         in Compressed Sparse Column format>
 > >>> f
 > <71987x1 sparse matrix of type '<type 'numpy.float64'>'
 >         with 52 stored elements (space for 52)
 >         in Compressed Sparse Column format>
 > >>> x = spsolve(K_dyn, f)
 > Traceback (most recent call last):
 >   File "<stdin>", line 1, in ?
 >   File
 > "/usr/local/lib64/python2.4/site-packages/scipy/linsolve/linsolve.py",
 > line 75, in spsolve
 >     b = asarray(b, dtype=data.dtype)
 >   File "/usr/local/lib64/python2.4/site-packages/numpy/core/numeric.py",
 > line 132, in asarray
 >     return array(a, dtype, copy=False, order=order)
 > ValueError: setting an array element with a sequence.
 >
 > Is this a bug ?
 >
 > Nils
 >




More information about the SciPy-user mailing list