eos 1.4.0
Loading...
Searching...
No Matches
Functions
cereal Namespace Reference

Serialisation of Eigen matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html). More...

Functions

template<class Archive , class _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
std::enable_if< traits::is_output_serializable< BinaryData< _Scalar >, Archive >::value, void >::type save (Archive &ar, const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &matrix)
 Serialise an Eigen::Matrix using cereal.
 
template<class Archive , class _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
std::enable_if< traits::is_input_serializable< BinaryData< _Scalar >, Archive >::value, void >::type load (Archive &ar, Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &matrix)
 De-serialise an Eigen::Matrix using cereal.
 

Detailed Description

Serialisation of Eigen matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html).

Contains serialisation for Eigen matrices to binary archives, i.e. matrices like Eigen::MatrixXf, Eigen::Matrix4d, or Eigen::Vector3f.

Todo: Add serialisation to and from JSON. Need to find out how to combine the two variants of SFINAE that are used.

Function Documentation

◆ load()

template<class Archive , class _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
std::enable_if< traits::is_input_serializable< BinaryData< _Scalar >, Archive >::value, void >::type cereal::load ( Archive &  ar,
Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  matrix 
)
inline

De-serialise an Eigen::Matrix using cereal.

Reads the block of binary data back from a cereal archive into the Eigen::Matrix.

Parameters
[in]arThe archive to deserialise from.
[in]matrixThe matrix to deserialise into.

◆ save()

template<class Archive , class _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
std::enable_if< traits::is_output_serializable< BinaryData< _Scalar >, Archive >::value, void >::type cereal::save ( Archive &  ar,
const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  matrix 
)
inline

Serialise an Eigen::Matrix using cereal.

Note: Writes the binary data from Matrix::data(), so not sure what happens if a matrix ever has non-contiguous data (if that can ever happen with Eigen).

Parameters
[in]arThe archive to serialise to.
[in]matrixThe matrix to serialise.