This forum has been archived. All content is frozen. Please use KDE Discuss instead.

IOFormat for sparse matrices

Tags: None
(comma "," separated)
katakombi
Registered Member
Posts
18
Karma
0

IOFormat for sparse matrices

Wed Oct 19, 2011 1:47 pm
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
Andre
Registered Member
Posts
90
Karma
1

Re: IOFormat for sparse matrices

Fri Oct 21, 2011 8:03 am
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
katakombi
Registered Member
Posts
18
Karma
0

Re: IOFormat for sparse matrices

Sat Oct 22, 2011 7:29 am
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
katakombi
Registered Member
Posts
18
Karma
0

Re: IOFormat for sparse matrices

Sun Oct 23, 2011 7:14 am
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!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]