DMP_BBO library
EigenBoostSerialization.hpp
Go to the documentation of this file.
1 
26 #ifndef EIGENBOOSTSERIALIZATION_HPP
27 #define EIGENBOOSTSERIALIZATION_HPP
28 
29 #include <eigen3/Eigen/Core>
30 
31 #include <boost/serialization/split_free.hpp>
32 #include <boost/serialization/level.hpp>
33 
34 namespace Eigen {
39 template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
40 std::string toString(const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & matrix);
41 } // namespace Eigen
42 
43 namespace boost {
44 namespace serialization {
45 
51 template<class Archive, typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
52 inline void save(
53  Archive & ar,
54  const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & matrix,
55  const unsigned int file_version
56 );
57 
63 template<class Archive, typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
64 inline void load(
65  Archive & ar,
66  Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & matrix,
67  const unsigned int file_version
68 );
69 
75 template<class Archive, typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
76 inline void serialize(
77  Archive & ar,
78  Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & t,
79  const unsigned int file_version
80 ){
81  split_free(ar, t, file_version);
82 }
83 
84 
85 } // namespace serialization
86 } // namespace boost
87 
88 // The next structure is not so relevant for the documentation, and has a very long name. So we
89 // exclude it from the documentation with doxygen's "cond"
91 
92 namespace boost {
93  namespace serialization {
94  template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
101  struct implementation_level<Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
102  {
104  typedef mpl::integral_c_tag tag;
106  typedef mpl::int_< boost::serialization::object_serializable > type;
108  static const int value = implementation_level::type::value;
109  };
110  }
111 }
113 
115 
178 #endif // #ifndef EIGENBOOSTSERIALIZATION_HPP
179 
void save(Archive &ar, const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &matrix, const unsigned int file_version)
Serialize an Eigen matrix to an archive.
void serialize(Archive &ar, Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &t, const unsigned int file_version)
Serialize an Eigen matrix to an archive.
void load(Archive &ar, Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &matrix, const unsigned int file_version)
Load ("deserialize") an Eigen matrix from an archive.
std::string toString(const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &matrix)
Convert an Eigen matrix to a string.
Source file for serialization of Eigen matrices.