CMS 3D CMS Logo

SMatrix.h
Go to the documentation of this file.
1 #ifndef CondFormats_External_SMATRIX_H
2 #define CondFormats_External_SMATRIX_H
3 
4 #include <boost/serialization/base_object.hpp>
5 #include <boost/serialization/nvp.hpp>
6 #include <boost/serialization/split_free.hpp>
7 
8 // std::vector used in DataFormats/EcalDetId/interface/EcalContainer.h
9 #include <boost/serialization/vector.hpp>
10 #include <boost/serialization/string.hpp>
11 #include <boost/serialization/map.hpp>
12 
13 #include <Math/SMatrix.h>
14 
15 namespace boost {
16 namespace serialization {
17 
18 /*
19  * Note regarding object tracking: all autos used here
20  * must resolve to untracked types, since we use local
21  * variables in the stack which could end up with the same
22  * address. For the moment, all types resolved by auto here
23  * are primitive types, which are untracked by default
24  * by Boost Serialization.
25  */
26 
27 
28 // Math/SMatrix.h
29 template<class Archive, typename T, unsigned int D1, unsigned int D2, class R>
30 void serialize(Archive & ar, ROOT::Math::SMatrix<T, D1, D2, R> & obj, const unsigned int)
31 {
32  unsigned int i = 0;
33  for (auto & value : obj) {
34  ar & boost::serialization::make_nvp(std::to_string(i).c_str(), value);
35  ++i;
36  }
37 }
38 
39 } // namespace serialization
40 } // namespace boost
41 
42 #endif
int i
Definition: DBlmapReader.cc:9
Definition: CLHEP.h:16
void serialize(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int v)
Definition: CLHEP.h:53
Definition: value.py:1