Boost logo

Boost Users :

Subject: Re: [Boost-users] How to Boost serialize a Eigen::Matrix class
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2012-09-27 03:56:50


Hi,

see the tutorials:

http://www.boost.org/doc/libs/1_51_0/libs/serialization/doc/tutorial.html#nonintrusiveversion

On 2012-09-27 08:35, Dip Ghosh wrote:
> Hi,
> I have used Eigen::Matrix class in my project. Now i wants to
> serialize the value of it through Boost::Serialize. Can someone help
> me on how to achieve that.
>
> My class is following,
>
> class RandomNode {
> private:
> friend class boost::serialization::access;
> template<class Archive>
> void serialize(Archive & ar, const unsigned int version)
> {
> ar & is_leaf_;
> ar & depth_;
> ar & num_classes_;
> ar & num_features_;
> // Split node members
> ar & random_feature_indices_;
> ar & random_feature_weights_;
> ar & threshold_;
> ar & leftChild_;
> ar & rightChild_;
>
> }
> bool is_leaf_;
> int depth_;
> int num_classes_;
> int num_features_;
>
> // Split node members
> VectorXi random_feature_indices_;
> VectorXd random_feature_weights_;
> double threshold_;
> RandomNode* leftChild_;
> RandomNode* rightChild_;
> // Methods and so on
> }
>
> And i am getting the following error :
>
> /usr/include/boost/serialization/access.hpp:118:9: error: ‘class
> Eigen::Matrix<double, 10000, 1>’ has no member named ‘serialize’
>
> thanks in advance.
>
> Regards,
> Dip


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net