Registered Member
|
Hello,
is there a simple method to save a MatrixXf and reload it on next program start? I do some heavy computations and would like to save them. I already tried writing the MatrixXf object to a stream, using something like:
where featureArray is of type MatrixXf But this saves only 12byte for a 1000x300 matrix, and after loading there are no elements in the matrix. Ismael |
Registered Member
|
We don't provide file IO, we only support printing to a c++ stream but no readback. You'll have to code that yourself!
if featureArray is of type MatrixXf, then instead of ofs.write((char *)&featureArray, sizeof(featureArray)); you should do ofs.write(featureArray.data(), featureArray.size() * sizeof(float));
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
note that a MatrixXf only contains 2 integer fields (numbers of rows and cols) and the array of coefficients. Nothing else.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Hi,
if (or better say when) you find a solution, can you post it here? I am in the same position as you are (regarding saving and loading). Regards, Dženan |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient