28#ifndef EIGEN_BOOST_SERIALIZATION
29#define EIGEN_BOOST_SERIALIZATION
31#ifdef CURVES_WITH_PINOCCHIO_SUPPORT
32#include <pinocchio/config.hpp>
33#if PINOCCHIO_VERSION_AT_LEAST(2, 6, 0)
34#define CURVES_WITH_PINOCCHIO_260
38#ifdef CURVES_WITH_PINOCCHIO_260
39#include <pinocchio/serialization/eigen.hpp>
43#include <boost/serialization/split_free.hpp>
44#include <boost/serialization/vector.hpp>
47namespace serialization {
48template <
class Archive,
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
49 int _MaxRows,
int _MaxCols>
52 const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& m,
55 Eigen::DenseIndex rows(m.rows()), cols(m.cols());
56 ar& BOOST_SERIALIZATION_NVP(rows);
57 ar& BOOST_SERIALIZATION_NVP(cols);
58 ar& make_nvp(
"data", make_array(m.data(), (
size_t)m.size()));
61template <
class Archive,
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
62 int _MaxRows,
int _MaxCols>
64 Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& m,
67 Eigen::DenseIndex rows, cols;
68 ar >> BOOST_SERIALIZATION_NVP(rows);
69 ar >> BOOST_SERIALIZATION_NVP(cols);
72 ar >> make_nvp(
"data", make_array(m.data(), (
size_t)m.size()));
75template <
class Archive,
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
76 int _MaxRows,
int _MaxCols>
79 Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& m,
80 const unsigned int version) {
81 split_free(ar, m, version);
88#undef CURVES_WITH_PINOCCHIO_260
void load(Archive &ar, Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &m, const unsigned int)
Definition eigen-matrix.hpp:63
void save(Archive &ar, const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &m, const unsigned int)
Definition eigen-matrix.hpp:50
void serialize(Archive &ar, Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &m, const unsigned int version)
Definition eigen-matrix.hpp:77
Definition eigen-matrix.hpp:46