Belle II Software development
EigenView.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/numerics/PlainMatrix.h>
11
12#include <Eigen/Core>
13
14namespace Belle2 {
19 namespace TrackFindingCDC {
20
22 template <class T, int M, int N>
23 auto mapToEigen(PlainMatrix<T, M, N>& plainMatrix)
24 {
25 return Eigen::Map<Eigen::Matrix<T, M, N, Eigen::ColMajor> >(plainMatrix.data());
26 }
27
29 template <class T, int M, int N>
30 auto mapToEigen(const PlainMatrix<T, M, N>& plainMatrix)
31 {
32 return Eigen::Map<const Eigen::Matrix<T, M, N, Eigen::ColMajor>>(plainMatrix.data());
33 }
34
36 template <class T, int M, int N>
37 auto& mapToEigen(Eigen::Matrix<T, M, N>& matrix)
38 {
39 return matrix;
40 }
41
43 template <class T, int M, int N>
44 const auto& mapToEigen(const Eigen::Matrix<T, M, N>& matrix)
45 {
46 return matrix;
47 }
48
49 }
51}
Abstract base class for different kinds of events.