views:

104

answers:

1

Is there any package to perform Sparse Linear Algebra computations, maybe based on fast and efficient C libraries? I searched on Hackage but I didn't find anything at regard: hmatrix, which uses GSL, BLAS and LAPACK, is great, but doesn't seem to include special algorithms to solve linear systems and eigen-values/vectors problems with sparse matrices. What I'd like to find, it is something similar to the sparse.linalg module in scipy. Thanks!

+2  A: 

As far as I know, there is no such package yet.

There was an article R. L. Winwright and M. E. Sexton. A study of sparse matrix representations for solving linear systems in a functional language. J. Functional Programming, 2(1):61-72, Jan. 1992., where they compared Quad-tree, Binary tree and run-length encoding sparse matrix representations in Miranda. Quad-trees were superiour on the CG method, and run-length encoding did well with SOR.

There was an implementation of the FEM in Haskell in 1993, Some issues in a functional implementation of a finite element algorithm. They used quad-trees too. The performance achieved was not stellar, but it was long long time ago... I expect that today Haskell can perform better. There also new array libraries to use, which may give better representations of the sparse matrices. Today we have IntMap, Vector and even Repa.

A library of the sparse solvers in Haskell (or bindings to C/Fortran solvers) is still to be written.

jetxee
scipy.sparse seems to farm lots of the heavy lifting out to superLU, which should be straightfowarard to bind: http://crd.lbl.gov/~xiaoye/SuperLU/, but one still needs code to create the sparse matrix representations to begin with.
sclv
Yes. There is also UMFPACK library of direct solvers http://www.cise.ufl.edu/research/sparse/umfpack/. It shouln't be too difficult to interface with either of them. And there are also iterative solvers which often require less memory to run. We can choose either to interface with existing libraries, or implement them from scratch. I am not sure which may turn faster. Again, there are TAUCS http://www.tau.ac.il/~stoledo/taucs/ and LASPACK http://www.mgnet.org/mgnet/Codes/laspack/ (only sequential) and PETSc http://www.mcs.anl.gov/petsc/petsc-2/ (huge).
jetxee
SciPy.Sparse uses Fortran implementations of the iterative methods from http://www.netlib.org/templates/
jetxee