hpp-constraints  4.10.1
Definition of basic geometric constraints for motion planning
serialization.hh
Go to the documentation of this file.
1 // Copyright (c) 2020, Joseph Mirabel
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-constraints.
5 // hpp-constraints is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-constraints is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-constraints. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_CONSTRAINTS_SERIALIZATION_HH
18 #define HPP_CONSTRAINTS_SERIALIZATION_HH
19 
20 #include <boost/serialization/serialization.hpp>
21 #include <boost/serialization/vector.hpp>
22 #include <boost/serialization/utility.hpp>
23 
25 
26 namespace boost {
27 namespace serialization {
28 
29 template<class Archive> inline void segments_serialize(Archive & ar, const char* n, Eigen::BlockIndex::segments_t& s) { ar & make_nvp(n, s); }
30 template<class Archive> inline void segments_serialize(Archive &, const char*, Eigen::internal::empty_struct&) {}
31 
32 template<class Archive, bool _allRows, bool _allCols>
34  const unsigned int version)
35 {
36  (void) version;
37  ar & make_nvp("nbRows", b.m_nbRows);
38  ar & make_nvp("nbCols", b.m_nbCols);
39  segments_serialize(ar, "rows", b.m_rows);
40  segments_serialize(ar, "cols", b.m_cols);
41 }
42 } // namespace serialization
43 } // namespace boost
44 
45 #endif // HPP_CONSTRAINTS_SERIALIZATION_HH
Definition: matrix-view.hh:123
Definition: serialization.hh:26
size_type m_nbCols
Definition: matrix-view.hh:670
size_type m_nbRows
Definition: matrix-view.hh:670
void segments_serialize(Archive &ar, const char *n, Eigen::BlockIndex::segments_t &s)
Definition: serialization.hh:29
std::vector< segment_t > segments_t
vector of segments
Definition: matrix-view.hh:43
ColIndices_t m_cols
Definition: matrix-view.hh:672
Definition: matrix-view.hh:139
void serialize(Archive &ar, Eigen::MatrixBlocks< _allRows, _allCols > &b, const unsigned int version)
Definition: serialization.hh:33
RowIndices_t m_rows
Definition: matrix-view.hh:671