[SciPy-dev] Iterative solvers cannot handle complex rhs

Nils Wagner nwagner at mecha.uni-stuttgart.de
Sat Mar 4 11:37:46 CST 2006


     x0,info = linalg.cgs(A,r)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/linalg/iterative.py", 
line 474, in cgs
     b = sb.asarray(b,typ)
   File 
"/usr/local/lib/python2.4/site-packages/numpy/core/numeric.py", 
line 74, in asarray
     return array(a, dtype, copy=False, fortran=fortran, 
ndmin=ndmin)
TypeError: array cannot be safely cast to required type
>>> type(A)
<type 'instance'>
>>> shape(A)
(4, 4)
>>> A
<4x4 sparse matrix of type '<type 'float64scalar'>'
         with 4 stored elements (space for 100)
         in Compressed Sparse Column format>
>>> r
array([ 0.87207973+0.45474362j,  0.41920682+0.12267298j,
         0.59096886+0.53802559j,  0.3652316 +0.86013843j])
>>> type(r)
<type 'numpy.ndarray'>
>>> shape(r)
(4,)

Nils




More information about the Scipy-dev mailing list