Belle II Software  release-05-01-25
RKMatrixEigenTransformations.h
1 #pragma once
2 
3 #include "EigenMatrixTypedefs.h"
4 #include "RKTools.h"
5 
6 namespace genfit {
7 
8  template <unsigned int rows, unsigned int cols>
9  Eigen::Matrix<double, rows, cols> RKMatrixToEigenMatrix(const RKMatrix<rows, cols>& rkMatrix) {
10  Eigen::Matrix<double, rows, cols> eigenMatrix;
11 
12  for (unsigned int row=0; row < rows; ++row) {
13  for (unsigned int col=0; col < cols; ++col) {
14  eigenMatrix(row, col) = rkMatrix[cols*row + col];
15  }
16  }
17 
18  return eigenMatrix;
19  }
20 
21 
22  template <unsigned int rows, unsigned int cols>
23  RKMatrix<rows, cols> eigenMatrixToRKMatrix(const Eigen::Matrix<double, rows, cols>& eigenMatrix) {
24  RKMatrix<rows, cols> rkMatrix;
25 
26  for (unsigned int row=0; row < rows; ++row) {
27  for (unsigned int col=0; col < cols; ++col) {
28  rkMatrix(row, col) = eigenMatrix(row, col);
29  }
30  }
31 
32  return rkMatrix;
33  }
34 
35 }
genfit
Defines for I/O streams used for error and debug printing.
Definition: AlignablePXDRecoHit.h:19