12 #include <Eigen/Dense>
14 #include <framework/logging/Logger.h>
21 template <
unsigned int NRows,
unsigned int NCols,
class AMatrix>
23 Eigen::Matrix<double, NRows, NCols, Eigen::RowMajor>
convertToEigen(
const AMatrix& matrix)
25 B2ASSERT(
"Matrix should be in the form " << NRows <<
"x" << NCols <<
", not " << matrix.GetNrows() <<
"x" << matrix.GetNcols(),
26 matrix.GetNcols() == NCols and matrix.GetNrows() == NRows);
27 return Eigen::Matrix<double, NRows, NCols, Eigen::RowMajor>(matrix.GetMatrixArray());
31 template <
unsigned int NRows>
32 Eigen::Matrix<double, NRows, 1>
convertToEigen(
const TVectorD& matrix)
34 B2ASSERT(
"Matrix should be in the form " << NRows <<
"x" << 1 <<
", not " << matrix.GetNrows() <<
"x" << 1,
35 matrix.GetNrows() == NRows);
36 return Eigen::Matrix<double, NRows, 1>(matrix.GetMatrixArray());