Regarding sparse matrix loading performance: I created an adapter for that a while ago and have reworked it now so it should be usable for others. Get it fromhere.
I used matrix data from http://math.nist.gov/MatrixMarket/data/SPARSKIT/fidap/fidap.html for testing. A few results:
Matrix 'fidap008.mtx' loaded in 172ms Size: 3096x3096, non-zeros: 106302 Benchmark started ... Using SparseMatrix: 1173ms Using StorageAdapter: 19ms Matrices equal: True Matrix 'fidap019.mtx' loaded in 427ms Size: 12005x12005, non-zeros: 259863 Benchmark started ... Using SparseMatrix: 11242ms Using StorageAdapter: 42ms Matrices equal: True
Looking at your sparse storage implementation, I found that
- if you got a m-by-n matrix, then usually storage.RowPointers is size m+1, where storage.RowPointers[m] = number of actual entries (non-zeros). You are using a size m array and storing the number of non-zeros explicitly, which makes some of the algorithms I use more complicated;
- it would be cool to have a public generic constructor like SparseCompressedRowMatrixStorage<T>(int m, int n).
Regards,
Chris
EDIT: Though I haven't found any problems with the code so far, keep in mind that it's not tested thoroughly!!!