Belle II Software  release-05-01-25
EigenView.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/numerics/PlainMatrix.h>
13 
14 #include <Eigen/Core>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
24  template <class T, int M, int N>
25  auto mapToEigen(PlainMatrix<T, M, N>& plainMatrix)
26  {
27  return Eigen::Map<Eigen::Matrix<T, M, N, Eigen::ColMajor> >(plainMatrix.data());
28  }
29 
31  template <class T, int M, int N>
32  auto mapToEigen(const PlainMatrix<T, M, N>& plainMatrix)
33  {
34  return Eigen::Map<const Eigen::Matrix<T, M, N, Eigen::ColMajor>>(plainMatrix.data());
35  }
36 
38  template <class T, int M, int N>
39  auto& mapToEigen(Eigen::Matrix<T, M, N>& matrix)
40  {
41  return matrix;
42  }
43 
45  template <class T, int M, int N>
46  const auto& mapToEigen(const Eigen::Matrix<T, M, N>& matrix)
47  {
48  return matrix;
49  }
50 
51  }
53 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19