On Apr 30, 2010, at 9:34 AM, Thierry Dumont wrote:
I have questions about RDF (and CDF) sparse matrices. How are they
implemented?
-for dense matrices, sage uses Scipy matrices and this is transparent.
-but, how are sparse matrices (RDF,CDF) implemented?
1) Are they Scipy matrices ?
2) if yes: there are different data structures for sparse
matrices in scipy:
a) an intermediate version which uses a list representation,
not good for number crunching,
b) csc and csr format, which are extremely common in numerical
linear algebra (SuperLU uses them, and iterative methods too).
How hare matrix(RDF,...sparse=True) stored?
sage: m = matrix(RDF, 5, sparse=True)
sage: type(m)
<type 'sage.matrix.matrix_generic_sparse.Matrix_generic_sparse'>
So it's our completely generic sparse implementation, stored as a
dictionary of non-zero entries.
http://hg.sagemath.org/sage-main/file/e2ccb846f296/sage/matrix/matrix_generic_sparse.pyx#l1
If it is possible for sage to build automatically csc or csr
matrices, then using sparse solvers is trivial. Otherwise I think it
is necessary to build Scipy matrices (lil matrices converted to csr
or csc format).
We don't have support for that, but it would probably be a nice thing
to have.
- Robert
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org