Re: Sparse Matrix Routines [message #40110] |
Thu, 22 July 2004 02:27  |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
On Tue, 20 Jul 2004 15:55:48 -0700, Marius wrote:
> IDL has a suite of sparse matrix routines based on those in Numerical
> Recipes in C, which optimize the algorithms for highly diagonal
> matrices (so that they store the diagonal elements separately from the
> rest of the nonzero elements). In the code I am currently working on,
> however, I have large rectangular matrices (of about 10^14 elements)
> which are extremely sparse (about 10^5 nonzero elements) and which are
> nothing like diagonal. I would much prefer to work with a set of
> sparse routines better suited to the problem (perhaps something simple
> such as storing the entire matrix as two vectors, one giving the
> nonzero values and the other giving the index locations) than use
> these standard routines, if at all possible.
>
> Does anyone know of any code (in IDL or in any other language) that
> uses such a simple storage scheme or one which is better suited to
> nondiagonal matrices? I'd be happy to hear of any ideas, and thanks in
> advance.
>
I think that's the way that MATLAB stores sparse matrices. I've never used
them, but I seem to remember from writing code to read the MATLAB data
files that sparse matrices were stored in two arrays, one of data and the
other of indices. Whether MATLAB is in any way optimised for any
particular type of sparse matrix I could not say.
Also, you might want to look into whether the sparse matrix extensions
for Python/SciPy/Numerical Python are of any use.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
|
|
|
Re: Sparse Matrix Routines [message #40219 is a reply to message #40110] |
Mon, 26 July 2004 14:16  |
nhagen
Messages: 3 Registered: February 2004
|
Junior Member |
|
|
Nigel Wade <nmw@ion.le.ac.uk> wrote:
> I think that's the way that MATLAB stores sparse matrices. I've never used
> them, but I seem to remember from writing code to read the MATLAB data
> files that sparse matrices were stored in two arrays, one of data and the
> other of indices. Whether MATLAB is in any way optimised for any
> particular type of sparse matrix I could not say.
>
> Also, you might want to look into whether the sparse matrix extensions
> for Python/SciPy/Numerical Python are of any use.
Thanks (to both responders) for pointing in a helpful direction. I've
located two sparse matrix libraries (SparseLib++ and
SparseMatrixToolkit) which provide some of the ideas I'm looking for.
As you mentioned, Matlab seems to provide a very straightforward
sparse matrix storage scheme much like I'm looking for, so I'm going
to look into whether they provide any information on the low-level
coding of their sparse matrix routines....
- Marius
|
|
|