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

File I/O of sparse matrices

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

File I/O of sparse matrices

Wed Jan 25, 2012 9:49 am
Hello,

what is the best way to write a sparse matrix into a file (resp. to read it from a file)?

best,
David
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: File I/O of sparse matrices

Wed Jan 25, 2012 3:08 pm
in short:

#include <unsupported/Eigen/SparseExtra>

...

saveMarket(mat, "filename.mtx");

..

loadMarket(mat, "filename.mtx");
davidhigh
Registered Member
Posts
18
Karma
0

Re: File I/O of sparse matrices

Wed Jan 25, 2012 3:22 pm
Wow, thats short.

thanks,
David
varelse
Registered Member
Posts
2
Karma
0

Re: File I/O of sparse matrices

Wed May 23, 2012 1:19 pm
I tried to use this, and I get:
error: ‘saveMarket’ is not a member of ‘Eigen’
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: File I/O of sparse matrices

Wed May 23, 2012 9:34 pm
which Eigen version are you using? and don't forget to #include <unsupported/Eigen/SparseExtra>
varelse
Registered Member
Posts
2
Karma
0

Re: File I/O of sparse matrices

Thu May 24, 2012 10:39 pm
I don't remember, but from the date of download it is probably 3.04.
Of course I included <unsupported/Eigen/SparseExtra>
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: File I/O of sparse matrices

Fri May 25, 2012 11:44 am
For sparse stuff, it is recommended to use the devel branch which at few bits to become the 3.1


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell