[SciPy-dev] solution sparse matrix

Dominique Orban dominique.orban@gmail....
Thu Mar 6 14:23:20 CST 2008


On Thu, Mar 6, 2008 at 2:03 PM, jose luis Lopez Martinez
<lopmart@gmail.com> wrote:
> hi
>
> the size of matrix sparse is 128^4(268,435,456 rows)x 128^4(268,435,456
> colums).
>
> the matrix have diagonald dominancies that is a sufficient condition
> for convergence of Jacobi iteration , gauss seidel and xor(relaxion method),
> but is slow for converge.
>
> it exist a command  in scipy  that solve sparse matrix using at the
> Gauss-Seidel iteration method o krylov iterative methods?

Is your matrix symmetric? If so, try the conjugate gradient (CG)
method. It will only require matrix-vector products. You can even get
around storing your sparse matrix by writing a function that evaluates
the result of a matrix-vector product. This can be interesting if the
density is high.

If your matrix is not symmetric, try Bi-Cgstab. It also only requires
matrix-vector products with the matrix (and not with its transpose).
Same comment as above regarding storage.

You can try Bi-Cgstab in either case, but if your matrix is symmetric,
it will come out as more expensive than CG, although equivalent on
paper. Specifically, it will perform twice as many matrix-vector
products.

For both, you need to specify a max number of iteration that is *at
least* the order of the matrix. If it isn't too ill conditioned,
chances are you'll need much less iterations than that.

See scipy.linalg.cg and scipy.linalg.bicgstab

Hope this helps
Dominique


More information about the Scipy-dev mailing list