ATLAS Offline Software
Loading...
Searching...
No Matches
ErrorMatrixBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ErrorMatrixBase_H
6#define ErrorMatrixBase_H
7
8#include "CLHEP/Matrix/SymMatrix.h"
9
10template <class Type>
12public:
13
15 ErrorMatrixBase(int dim) : m_matrix(dim) {}
16 ErrorMatrixBase(const CLHEP::HepSymMatrix& mat) : m_matrix(mat) {}
17
18 inline int num_row() const {return m_matrix.num_row();}
19 inline int num_col() const {return m_matrix.num_col();}
20
22 const double & operator()(int row, int col) const;
23 double & operator()(int row, int col);
24
26 const double & operator()(int diagElement) const;
27 double & operator()(int diagElement);
28
29 const CLHEP::HepSymMatrix& hsm() const {return m_matrix;}
30
32 public:
34 inline double & operator[](int);
35 private:
37 int m_r;
38 };
40 public:
42 inline const double & operator[](int) const;
43 private:
45 int m_r;
46 };
47 // helper class to implement m[i][j]
48
49 inline ErrorMatrixBase_row operator[] (int);
50 inline ErrorMatrixBase_row_const operator[] (int) const;
51
52private:
53
54 CLHEP::HepSymMatrix m_matrix;
55
56protected:
57
58 const CLHEP::HepSymMatrix& impl() const {return m_matrix;}
59 CLHEP::HepSymMatrix& impl() {return m_matrix;}
60
61};
62
63template <class Type>
64inline const double & ErrorMatrixBase<Type>::operator()(int row, int col) const
65{
66 return m_matrix(row+1,col+1);
67}
68
69template <class Type>
70inline const double & ErrorMatrixBase<Type>::operator()(int diag) const
71{
72 return m_matrix(diag+1,diag+1);
73}
74
75template <class Type>
76inline double & ErrorMatrixBase<Type>::operator()(int row, int col)
77{
78 return m_matrix(row+1,col+1);
79}
80
81template <class Type>
82inline double & ErrorMatrixBase<Type>::operator()(int diag)
83{
84 return m_matrix(diag+1,diag+1);
85}
86
87template <class Type>
92
93template <class Type>
98
99template <class Type>
101{
102 return m_a.impl()(m_r,c);
103}
104
105template <class Type>
106inline const double &
108{
109 return m_a.impl()(m_r,c);
110}
111
112template <class Type>
117
118template <class Type>
123
124
125#endif
static Double_t a
ErrorMatrixBase_row_const(const ErrorMatrixBase &, int)
ErrorMatrixBase_row(ErrorMatrixBase &, int)
const double & operator()(int diagElement) const
The single argument versions return diagonal elements.
const CLHEP::HepSymMatrix & hsm() const
ErrorMatrixBase(const CLHEP::HepSymMatrix &mat)
ErrorMatrixBase(int dim)
int num_col() const
int num_row() const
const CLHEP::HepSymMatrix & impl() const
ErrorMatrixBase_row operator[](int)
const double & operator()(int row, int col) const
The element access operator M(i,j) starts counting indeces from zero.
double & operator()(int row, int col)
CLHEP::HepSymMatrix & impl()
double & operator()(int diagElement)
int r
Definition globals.cxx:22