[SciPy-dev] Bug in linalg.cgs

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


     x0,info = linalg.cgs(A,r)
   File 
"/usr/local/lib/python2.4/site-packages/scipy/linalg/iterative.py", 
line 501, in cgs
     work[slice2] += sclr1*matvec(work[slice1])
ValueError: invalid return array shape
>>> A
matrix([[ 1.,  0.,  0.,  0.],
        [ 0.,  1.,  0.,  0.],
        [ 0.,  0.,  1.,  0.],
        [ 0.,  0.,  0.,  1.]])
>>> r
array([ 0.17858324,  0.42785877,  0.48033897, 
 0.85571193])
>>> help (linalg.cgs)

>>> shape(r)
(4,)
>>> shape(A)
(4, 4)
>>> type(A)
<class 'numpy.core.defmatrix.matrix'>
>>> type(r)
<type 'numpy.ndarray'>




More information about the Scipy-dev mailing list