ATLAS Offline Software
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 
10 template <class Type>
12 public:
13 
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:
41  inline ErrorMatrixBase_row_const(const ErrorMatrixBase&,int);
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 
52 private:
53 
54  CLHEP::HepSymMatrix m_matrix;
55 
56 protected:
57 
58  const CLHEP::HepSymMatrix& impl() const {return m_matrix;}
59  CLHEP::HepSymMatrix& impl() {return m_matrix;}
60 
61 };
62 
63 template <class Type>
64 inline const double & ErrorMatrixBase<Type>::operator()(int row, int col) const
65 {
66  return m_matrix(row+1,col+1);
67 }
68 
69 template <class Type>
70 inline const double & ErrorMatrixBase<Type>::operator()(int diag) const
71 {
72  return m_matrix(diag+1,diag+1);
73 }
74 
75 template <class Type>
76 inline double & ErrorMatrixBase<Type>::operator()(int row, int col)
77 {
78  return m_matrix(row+1,col+1);
79 }
80 
81 template <class Type>
82 inline double & ErrorMatrixBase<Type>::operator()(int diag)
83 {
84  return m_matrix(diag+1,diag+1);
85 }
86 
87 template <class Type>
89 {
90  return ErrorMatrixBase_row(*this,r);
91 }
92 
93 template <class Type>
95 {
96  return ErrorMatrixBase_row_const(*this,r);
97 }
98 
99 template <class Type>
101 {
102  return m_a.impl()(m_r,c);
103 }
104 
105 template <class Type>
106 inline const double &
108 {
109  return m_a.impl()(m_r,c);
110 }
111 
112 template <class Type>
114  int r)
115  : m_a(a), m_r(r)
116 {}
117 
118 template <class Type>
120 (const ErrorMatrixBase&a,int r)
121  : m_a(a), m_r(r)
122 {}
123 
124 
125 #endif
query_example.row
row
Definition: query_example.py:24
beamspotman.r
def r
Definition: beamspotman.py:676
ErrorMatrixBase::operator()
double & operator()(int row, int col)
Definition: ErrorMatrixBase.h:76
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
ErrorMatrixBase::ErrorMatrixBase_row_const
Definition: ErrorMatrixBase.h:39
ErrorMatrixBase
Definition: ErrorMatrixBase.h:11
ErrorMatrixBase::ErrorMatrixBase_row
Definition: ErrorMatrixBase.h:31
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
ErrorMatrixBase::num_row
int num_row() const
Definition: ErrorMatrixBase.h:18
ErrorMatrixBase::num_col
int num_col() const
Definition: ErrorMatrixBase.h:19
ErrorMatrixBase::ErrorMatrixBase_row::operator[]
double & operator[](int)
Definition: ErrorMatrixBase.h:100
ErrorMatrixBase::m_matrix
CLHEP::HepSymMatrix m_matrix
Definition: ErrorMatrixBase.h:54
ErrorMatrixBase::ErrorMatrixBase_row::m_a
ErrorMatrixBase & m_a
Definition: ErrorMatrixBase.h:36
ErrorMatrixBase::ErrorMatrixBase
ErrorMatrixBase(const CLHEP::HepSymMatrix &mat)
Definition: ErrorMatrixBase.h:16
ErrorMatrixBase::impl
const CLHEP::HepSymMatrix & impl() const
Definition: ErrorMatrixBase.h:58
ErrorMatrixBase::ErrorMatrixBase_row_const::m_r
int m_r
Definition: ErrorMatrixBase.h:45
ErrorMatrixBase::impl
CLHEP::HepSymMatrix & impl()
Definition: ErrorMatrixBase.h:59
ErrorMatrixBase::ErrorMatrixBase_row_const::m_a
const ErrorMatrixBase & m_a
Definition: ErrorMatrixBase.h:44
ErrorMatrixBase::ErrorMatrixBase
ErrorMatrixBase()
Definition: ErrorMatrixBase.h:14
ErrorMatrixBase::ErrorMatrixBase_row_const::operator[]
const double & operator[](int) const
Definition: ErrorMatrixBase.h:107
ErrorMatrixBase::ErrorMatrixBase_row_const::ErrorMatrixBase_row_const
ErrorMatrixBase_row_const(const ErrorMatrixBase &, int)
Definition: ErrorMatrixBase.h:120
query_example.col
col
Definition: query_example.py:7
a
TList * a
Definition: liststreamerinfos.cxx:10
ErrorMatrixBase::operator[]
ErrorMatrixBase_row operator[](int)
Definition: ErrorMatrixBase.h:88
ErrorMatrixBase::ErrorMatrixBase_row::ErrorMatrixBase_row
ErrorMatrixBase_row(ErrorMatrixBase &, int)
Definition: ErrorMatrixBase.h:113
ErrorMatrixBase::operator()
const double & operator()(int diagElement) const
The single argument versions return diagonal elements.
Definition: ErrorMatrixBase.h:70
ErrorMatrixBase::operator()
double & operator()(int diagElement)
Definition: ErrorMatrixBase.h:82
ErrorMatrixBase::ErrorMatrixBase
ErrorMatrixBase(int dim)
Definition: ErrorMatrixBase.h:15
ErrorMatrixBase::hsm
const CLHEP::HepSymMatrix & hsm() const
Definition: ErrorMatrixBase.h:29
ErrorMatrixBase::operator()
const double & operator()(int row, int col) const
The element access operator M(i,j) starts counting indeces from zero.
Definition: ErrorMatrixBase.h:64
ErrorMatrixBase::ErrorMatrixBase_row::m_r
int m_r
Definition: ErrorMatrixBase.h:37
python.compressB64.c
def c
Definition: compressB64.py:93