Warning, file /include/Geant4/G4ErrorSymMatrix.icc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 inline G4ErrorSymMatrix::G4ErrorSymMatrix()
0032 : m(0)
0033 , nrow(0)
0034 , size(0)
0035 {}
0036
0037 inline G4int G4ErrorSymMatrix::num_row() const { return nrow; }
0038
0039 inline G4int G4ErrorSymMatrix::num_col() const { return nrow; }
0040
0041 inline G4int G4ErrorSymMatrix::num_size() const { return size; }
0042
0043 inline G4double& G4ErrorSymMatrix::fast(G4int row, G4int col)
0044 {
0045 return *(m.begin() + (row * (row - 1)) / 2 + (col - 1));
0046 }
0047
0048 inline const G4double& G4ErrorSymMatrix::fast(G4int row, G4int col) const
0049 {
0050 return *(m.begin() + (row * (row - 1)) / 2 + (col - 1));
0051 }
0052
0053 inline G4double& G4ErrorSymMatrix::operator()(G4int row, G4int col)
0054 {
0055 return (row >= col ? fast(row, col) : fast(col, row));
0056 }
0057
0058 inline const G4double& G4ErrorSymMatrix::operator()(G4int row, G4int col) const
0059 {
0060 return (row >= col ? fast(row, col) : fast(col, row));
0061 }
0062
0063 inline void G4ErrorSymMatrix::assign(const G4ErrorSymMatrix& mat)
0064 {
0065 (*this) = mat;
0066 }
0067
0068 inline G4ErrorSymMatrix G4ErrorSymMatrix::T() const
0069 {
0070 return G4ErrorSymMatrix(*this);
0071 }
0072
0073 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row G4ErrorSymMatrix::operator[](
0074 G4int r)
0075 {
0076 G4ErrorSymMatrix_row b(*this, r);
0077 return b;
0078 }
0079
0080 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row_const G4ErrorSymMatrix::
0081 operator[](G4int r) const
0082 {
0083 const G4ErrorSymMatrix_row_const b(*this, r);
0084 return b;
0085 }
0086
0087 inline G4double& G4ErrorSymMatrix::G4ErrorSymMatrix_row::operator[](G4int c)
0088 {
0089 if(_r >= c)
0090 {
0091 return *(_a.m.begin() + (_r + 1) * _r / 2 + c);
0092 }
0093 else
0094 {
0095 return *(_a.m.begin() + (c + 1) * c / 2 + _r);
0096 }
0097 }
0098
0099 inline const G4double& G4ErrorSymMatrix::G4ErrorSymMatrix_row_const::operator[](
0100 G4int c) const
0101 {
0102 if(_r >= c)
0103 {
0104 return *(_a.m.begin() + (_r + 1) * _r / 2 + c);
0105 }
0106 else
0107 {
0108 return *(_a.m.begin() + (c + 1) * c / 2 + _r);
0109 }
0110 }
0111
0112 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row::G4ErrorSymMatrix_row(
0113 G4ErrorSymMatrix& a, G4int r)
0114 : _a(a)
0115 , _r(r)
0116 {}
0117
0118 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row_const::G4ErrorSymMatrix_row_const(
0119 const G4ErrorSymMatrix& a, G4int r)
0120 : _a(a)
0121 , _r(r)
0122 {}
0123
0124 inline G4ErrorSymMatrix G4ErrorSymMatrix::inverse(G4int& ifail) const
0125 {
0126 G4ErrorSymMatrix mTmp(*this);
0127 mTmp.invert(ifail);
0128 return mTmp;
0129 }