CMS 3D CMS Logo

TestSoA.h
Go to the documentation of this file.
1 #ifndef DataFormats_PortableTestObjects_interface_TestSoA_h
2 #define DataFormats_PortableTestObjects_interface_TestSoA_h
3 
4 #include <array>
5 
6 #include <Eigen/Core>
7 #include <Eigen/Dense>
8 
13 
14 namespace portabletest {
15 
16  // the type aliases are needed because commas confuse macros
18  //using Array = std::array<short, 4>;
19  using Matrix = Eigen::Matrix<double, 3, 6>;
20 
21  // SoA layout with x, y, z, id fields
23  // columns: one value per element
24  SOA_COLUMN(double, x),
25  SOA_COLUMN(double, y),
26  SOA_COLUMN(double, z),
27  SOA_COLUMN(int32_t, id),
28  // scalars: one value for the whole structure
29  SOA_SCALAR(double, r),
30  // column of arrays: one fixed-size array per element
32  // Eigen columns: each matrix element is stored in a separate column
34 
35  using TestSoA = TestSoALayout<>;
36 
37 } // namespace portabletest
38 
39 #endif // DataFormats_PortableTestObjects_interface_TestSoA_h
Eigen::Matrix< double, 3, 6 > Matrix
Definition: TestSoA.h:19
#define GENERATE_SOA_LAYOUT(CLASS,...)
Definition: SoALayout.h:426
#define SOA_SCALAR(TYPE, NAME)
Definition: SoACommon.h:553
#define SOA_EIGEN_COLUMN(TYPE, NAME)
Definition: SoACommon.h:555
#define SOA_COLUMN(TYPE, NAME)
Definition: SoACommon.h:554