Re: [eigen] Eigen binary I/O proposal

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

> First things first.
> 
> http://sites.google.com/site/rpg314/Home/eigen-proposal
> 
> This is a battle-tested, well commented (I think) piece of code along
> with unit tests. The largest file I used it with was 1.2 GB.
> 
> There has been some demand for serialization of Eigen objects here
> 
> http://forum.kde.org/viewtopic.php?f=74&t=61960.
> 
> So I think this may fit the bill. There could be a lot of scope for
> template tricks to beautify the API, but for my needs, I could manage
> to to work with raw C too. I have tested it on Linux 32 bit with gcc
> 3.4 and linux 64 bit, (both gcc 4.3 and gcc 4.4) respectively.
> 
> Comments/questions/cribs/suggestions/flames/rants/commendations(!) welcome.

I've been doing something similar but less accurate using
Boost Interprocess's memory mapped files. But I only use it for sparse
matrices. I'm just saving those three arrays. Using Boost simplifies the
code. So mapping a file you only do:

file_mapping m_file("my_file.dat", read_only);
mapped_region region(m_file, read_only);

Then I just set the pointers as needed using MappedSparseMatrix.

But I have no header which is kind of bad. So I have to remember what
kind of matrix is stored in a file.
I just looked quickly through your code. Do you handle Endianness? I
guess not? I ignored this problem as well in my approach.
BTW Why don't you use sizeof instead of writing your size function?

Regards,
Jens



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/