[Matrix-SIG] Sparse matrices
Travis Oliphant
Oliphant.Travis@mayo.edu
Sun, 30 May 1999 01:06:48 -0500 (CDT)
After reading many of the informative posts here and thinking a little bit
more about the problem of sparse matrices (as least as it applies to me),
I've come up with the following solution skeleton and am requesting
feedback. I'm going to have a little time this next week and would like
to make some progress on improving the sparse matrix support in Python.
The basic idea is to define a sparse matrix class in Python which uses
NumPy arrays to store the data and index information. The storage format
will be variable and indicated by an attribute.
Most of the manipulations and basic math operations will be handled by C
or Fortran code (right now I'm looking quite favorably at SPARSEKIT2 by
Yousef Saad) which is called by the sparse matrix class methods (via a
C-module, of course).
In addition to this class there will be a collection of iterative and
direct solvers that take as arguments sparse matrix objects. These could
be written in Python or just wrapped up versions of solvers available in
Fortran on the net (like in SPARSEKIT2).
SPARSEKIT2 also has a wide selection of conversion routines which could be
used. The problem I see with SPARSEKIT2 is that it is defined only for
double precision types and I need a complex sparse matrix. It may be
possible, however, to compile the key components of SPARSEKIT2 for
complex numbers fairly straightforwardly (search-and-replace, comments?)
That's a plan of attack as I (perhaps naively) see it. Any
comments would be appreciated and encouraged, as I know there are people
on this list with a lot more experience in this area than I have.
Thanks,
Travis Oliphant