GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
RKTools.h
Go to the documentation of this file.
1/* Copyright 2008-2009, Technische Universitaet Muenchen,
2 Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3
4 This file is part of GENFIT.
5
6 GENFIT is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GENFIT is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18*/
19
23
24#ifndef genfit_RKTools_h
25#define genfit_RKTools_h
26
27#include <stddef.h>
28#include <algorithm>
29#include <initializer_list>
30
31namespace genfit {
32
33template <size_t nRows, size_t nCols>
34struct RKMatrix {
35 double vals[nRows * nCols];
36
37 RKMatrix() = default;
38 RKMatrix(const RKMatrix&) = default;
39 RKMatrix(std::initializer_list<double> initList) {
40 std::copy(initList.begin(), initList.end(), vals);
41 };
42
43 double& operator()(size_t iRow, size_t iCol) {
44 return vals[nCols*iRow + iCol];
45 }
46 double& operator[](size_t n) {
47 return vals[n];
48 }
49 const double& operator[](size_t n) const {
50 return vals[n];
51 }
52
53 double* begin() { return vals; }
54 double* end() { return vals + nRows * nCols; }
55 const double* begin() const { return vals; }
56 const double* end() const { return vals + nRows * nCols; }
57
59 std::copy(o.begin(), o.end(), this->begin());
60 return *this;
61 }
62
63 void print();
64};
65
76
80namespace RKTools {
81
82 void J_pMTxcov5xJ_pM(const M5x7& J_pM, const M5x5& cov5, M7x7& out7);
83 void J_pMTxcov5xJ_pM(const M5x6& J_pM, const M5x5& cov5, M6x6& out6);
84
85 void J_MpTxcov7xJ_Mp(const M7x5& J_Mp, const M7x7& cov7, M5x5& out5);
86 void J_MpTxcov6xJ_Mp(const M6x5& J_Mp, const M6x6& cov6, M5x5& out5);
87
88 void J_pMTTxJ_MMTTxJ_MpTT(const M7x5& J_pMT, const M7x7& J_MMT, const M5x7& J_MpT, M5x5& J_pp);
89
90 void Np_N_NpT(const M7x7& Np, M7x7& N);
91
92 void printDim(const double* mat, unsigned int dimX, unsigned int dimY);
93
94}
95
96template<size_t nRows, size_t nCols>
97inline void
99 RKTools::printDim(this->vals, nRows, nCols);
100}
101
102} /* End of namespace genfit */
104
105#endif // genfit_RKTools_h
106
Array matrix multiplications used in RKTrackRep.
Definition RKTools.h:80
void J_pMTxcov5xJ_pM(const M5x7 &J_pM, const M5x5 &cov5, M7x7 &out7)
Definition RKTools.cc:31
void J_MpTxcov6xJ_Mp(const M6x5 &J_Mp, const M6x6 &cov6, M5x5 &out5)
Definition RKTools.cc:261
void Np_N_NpT(const M7x7 &Np, M7x7 &N)
Definition RKTools.cc:432
void J_pMTTxJ_MMTTxJ_MpTT(const M7x5 &J_pMT, const M7x7 &J_MMT, const M5x7 &J_MpT, M5x5 &J_pp)
Definition RKTools.cc:335
void printDim(const double *mat, unsigned int dimX, unsigned int dimY)
Definition RKTools.cc:497
void J_MpTxcov7xJ_Mp(const M7x5 &J_Mp, const M7x7 &cov7, M5x5 &out5)
Definition RKTools.cc:189
Defines for I/O streams used for error and debug printing.
RKMatrix< 6, 6 > M6x6
Definition RKTools.h:70
RKMatrix< 1, 4 > M1x4
Definition RKTools.h:67
RKMatrix< 5, 5 > M5x5
Definition RKTools.h:69
RKMatrix< 5, 6 > M5x6
Definition RKTools.h:74
RKMatrix< 5, 7 > M5x7
Definition RKTools.h:75
RKMatrix< 1, 7 > M1x7
Definition RKTools.h:68
RKMatrix< 7, 7 > M7x7
Definition RKTools.h:71
RKMatrix< 7, 5 > M7x5
Definition RKTools.h:73
RKMatrix< 6, 5 > M6x5
Definition RKTools.h:72
RKMatrix< 1, 3 > M1x3
Definition RKTools.h:66
double & operator[](size_t n)
Definition RKTools.h:46
const double * end() const
Definition RKTools.h:56
const double & operator[](size_t n) const
Definition RKTools.h:49
RKMatrix()=default
RKMatrix< nRows, nCols > & operator=(const RKMatrix< nRows, nCols > &o)
Definition RKTools.h:58
double & operator()(size_t iRow, size_t iCol)
Definition RKTools.h:43
double * begin()
Definition RKTools.h:53
RKMatrix(std::initializer_list< double > initList)
Definition RKTools.h:39
const double * begin() const
Definition RKTools.h:55
double * end()
Definition RKTools.h:54
double vals[nRows *nCols]
Definition RKTools.h:35
RKMatrix(const RKMatrix &)=default