[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)
line 474, in cgs
     b = sb.asarray(b,typ)
line 74, in asarray
     return array(a, dtype, copy=False, fortran=fortran, 
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)


More information about the Scipy-dev mailing list