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

Raul Acuña raultron@gmail....
Thu Dec 9 19:49:54 CST 2010


I made a typing error in the previous post, the first code segment is this
one instead:

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


On Thu, Dec 9, 2010 at 9:12 PM, Raul Acuña <raultron@gmail.com> wrote:

> 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.
>



-- 
Ing. Raúl Acuña

Profesor @Universidad Simón Bolívar
Grupo de Mecatrónica
Departamento de Electrónica y Circuitos
Tel. +58-212-4121983 / Cel +58-412-5840317
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101209/e21bad5d/attachment.html 


More information about the SciPy-User mailing list