[SciPy-User] scipy.sparse.linalg.bicg for Non Symmetric Matrix.

Raul Acuña raultron@gmail....
Thu Dec 9 19:42:28 CST 2010


Hi,

Am using the iterative methods of scipy.sparse.linalg for solving a linear
system of equations Ax = b. My matrix A is non symmetric. I've been using
the scipy.sparse.linalg.cg() function multiplying both matrix "A" and "b"
with the transpose of A so the matrix will become symmetric:

Asym = matrix(dot(A.T,A))
bsym = matrix(dot(A.T,b))
sol = cg(A,b,tol = 1e-10,maxiter=30)

Also i've been reading about the biconjugate gradient method, and if i am
not mistaken the literature says that this method works on
non-symmetric matrix, but when i try to use  scipy.sparse.linalg.bicg() it
wont work:

sol = bicg(A,b,tol = 1e-10,maxiter=30)

   File
"C:\Python26\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py",
line 74, in bicg
          A,M,x,b,postprocess = make_system(A,M,x0,b,xtype)
   File "C:\Python26\lib\site-packages\scipy\sparse\linalg\isolve\utils.py",
line 65, in make_system
          raise ValueError('expected square matrix (shape=%s)' % shape)
          NameError: global name 'shape' is not defined

Any help will be greatly appreciated, am comparing this methods for my data
with an important emphasis on speed for my master thesis, so any discrepancy
with the theory would be a great problem for me.

Thanks in advance,


Raúl Acuña.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101209/753ccedd/attachment.html 


More information about the SciPy-User mailing list