added serialization

release/4.3a0
Manohar Paluri 2010-04-07 17:22:10 +00:00
parent f06d1a2e30
commit 0355c14007
2 changed files with 19 additions and 0 deletions

View File

@ -12,6 +12,8 @@
#include <map> #include <map>
#include <set> #include <set>
#include <boost/serialization/map.hpp>
#include "Vector.h" #include "Vector.h"
#include "Testable.h" #include "Testable.h"
#include "VectorConfig.h" #include "VectorConfig.h"
@ -114,6 +116,14 @@ namespace gtsam {
values_.clear(); values_.clear();
} }
private:
/** Serialization function */
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
ar & BOOST_SERIALIZATION_NVP(values_);
}
}; };
/** Dimensionality of the tangent space */ /** Dimensionality of the tangent space */
@ -131,5 +141,6 @@ namespace gtsam {
/** Get a delta config about a linearization point c0 */ /** Get a delta config about a linearization point c0 */
template<class J, class T> template<class J, class T>
VectorConfig logmap(const LieConfig<J,T>& c0, const LieConfig<J,T>& cp); VectorConfig logmap(const LieConfig<J,T>& c0, const LieConfig<J,T>& cp);
} }

View File

@ -480,6 +480,14 @@ namespace gtsam {
bool exists(const J1& j) const { return first_.exists(j); } bool exists(const J1& j) const { return first_.exists(j); }
bool exists(const J2& j) const { return second_.exists(j); } bool exists(const J2& j) const { return second_.exists(j); }
private:
/** Serialization function */
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
ar & BOOST_SERIALIZATION_NVP(first_);
ar & BOOST_SERIALIZATION_NVP(second_);
}
}; };