By putting the following free function into your compilation, you effectively make Boost.Serialization aware of how to serialize Eigen types:
namespace boost { template<class Archive, typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> inline void serialize( Archive & ar, Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & t, const unsigned int file_version ) { for(size_t i=0; i<t.size(); i++) ar & t.data()[i]; } }
In the above example, you should be able (unchecked):
void serialize(Archive & ar, const unsigned int version) { ar & *this; }
Take a look at my previous answer on serializing Eigen types using Boost.Serialization for a more detailed example.
source share