[SciPy-user] LU decomposition of a sparse matrix ?

Travis E. Oliphant oliphant at ee.byu.edu
Fri Jan 16 15:47:45 CST 2004


Nils Wagner wrote:
> Hi all,
> 
> from scipy import *
> from scipy.sparse import *
> def sylvester(n):
>     d = zeros((2, n), Float)
>     d[0, :] = arange(n, 0, -1)
>     d[1, :] = arange(1, n+1)
>     print d
>     A = spdiags(d, [-1, 1], n, n)
>     return A
> n = 6
> S = sylvester(n)
> print S
> 
> Is it possible to convert a sparse matrix into a full matrix in scipy ?

There is not a canned function yet I don't think (but check the class 
definition).

> 
> How about LU decomposition in case of sparse matrices ?
> 

Look at the example of solving a sparse linear system (it does an LU 
decomposition first, I believe).

-Travis




More information about the SciPy-user mailing list