Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: How to load data into matrix

$
0
0

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

  1. 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;
  2. 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!!!


Viewing all articles
Browse latest Browse all 971

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>