Registered Member
|
Hi there,
I want to IO sparse matrices with lib Eigen. It seems that the IOFormat class is used for defining the output format of the << / >> operators of vectors/matrices. Is there a way to write and read a compact representation of my sparse matrices/vectors? The matrices I use are really very sparse and it would not make much sense to read/write just zeros thanks for enlightenment Stefan |
Registered Member
|
I thought I remembered that you could access the internal arrays, basically one data array and two index arrays, but apparently that changed. Otherwise you could have just stored these three.
'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett
'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger |
Registered Member
|
That's sad...
Guess I could simply dump/fill all coeffs in a loop and skip all zeros, but neither this is very efficient nor does it necessarily preserve the internal memory representation of my matrices. Ihe InnerIterator from the tutorial looks exactly like what I need, but it seems to have gone. Stefan |
Registered Member
|
Ok, my wrong...it is not gone of course!
But the output looks buggy for DynamicSparseMatrices - if I convert into a SparseMatrix before the code from the tutorial seems to work! |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]