Mailing List Archive

Sparse matrix equation solver sought
A colleague and I have been playing at...er, writing a simple finite
element code in Python, having great fun saying things like

for elt in Elements:
Ke = elt.StiffnessMatrix()

We've used the NumPy and LinearAlgebra modules with good results.
(Did I really used to do this stuff in Fortran?)

The time has come to tackle some larger problems, leading to the need
to solve the equation A x = b where A is a real, symmetric matrix of
order N up to 5000 or so. In simple tests,

x = LinearAlgebra.solve_linear_equations(A, b)

has eventually ground out an answer, but the time and memory
requirements are prohibitive.

Fortunately, A is sparse, being banded with a few outlying nonzero
elements. We'd like to capitalize on this, and suspect Somebody Must
Have Done This Before, but we've been unable to find much on the topic
beyond some months-old posts in the matrix-sig archive. Before I
charge off to reinvent the wheel by trying to interface what we've got
to a C library (which doesn't look too painful, actually), would
someone please tell me where to look for the state of the
sparse-matrix Python art? (Or, if more appropriate, tell me it ain't
never gonna work in Python and why?)

Best regards,
Michael

Ahh, for the days of rectangular domains and analytical solutions....

--
D. Michael McFarland <mcfarlan@caber-eng.com>
Caber Engineering, Inc., Glastonbury, Connecticut
Sparse matrix equation solver sought [ In reply to ]
Numerical python needs some solid sparse matrix methods. It is definitely
possible, and least a couple of people have done some work.

There is a sparsematrix module linked to on the scientific computing topic
page at www.python.org. The link is
http://www.ucalgary.ca/~nascheme/python/sparsemodule-0.2.tar.gz

Konrad Hinsen has also done some very specific sparse matrix work in his
molecular modeling toolkit. His work is also linked at
http://www.python.org/topics/scicomp/numbercrunching.html

If you have some sparse matrix code you are used to in C or Fortran it is
really pretty easy to get it to interface with NumPy arrays (after you've
done it a couple of times :-) ). If the code you will be using is freely
available I would be willing to help as I'm looking to put together a
sparse matrix package at some point in the next several months.

Good luck,

Travis Oliphant