00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 inline G4ErrorSymMatrix::G4ErrorSymMatrix()
00034 : m(0), nrow(0), size(0)
00035 {
00036 }
00037
00038 inline G4int G4ErrorSymMatrix::num_row() const
00039 {
00040 return nrow;
00041 }
00042
00043 inline G4int G4ErrorSymMatrix::num_col() const
00044 {
00045 return nrow;
00046 }
00047
00048 inline G4int G4ErrorSymMatrix::num_size() const
00049 {
00050 return size;
00051 }
00052
00053 inline G4double & G4ErrorSymMatrix::fast(G4int row,G4int col)
00054 {
00055 return *(m.begin()+(row*(row-1))/2+(col-1));
00056 }
00057
00058 inline const G4double & G4ErrorSymMatrix::fast(G4int row,G4int col) const
00059 {
00060 return *(m.begin()+(row*(row-1))/2+(col-1));
00061 }
00062
00063 inline G4double &
00064 G4ErrorSymMatrix::operator()(G4int row, G4int col)
00065 {
00066 return (row>=col? fast(row,col) : fast(col,row));
00067 }
00068
00069 inline const G4double &
00070 G4ErrorSymMatrix::operator()(G4int row, G4int col) const
00071 {
00072 return (row>=col? fast(row,col) : fast(col,row));
00073 }
00074
00075 inline void G4ErrorSymMatrix::assign(const G4ErrorSymMatrix &mat)
00076 {
00077 (*this)=mat;
00078 }
00079
00080 inline G4ErrorSymMatrix G4ErrorSymMatrix::T() const
00081 {
00082 return G4ErrorSymMatrix(*this);
00083 }
00084
00085 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row
00086 G4ErrorSymMatrix::operator[] (G4int r)
00087 {
00088 G4ErrorSymMatrix_row b(*this,r);
00089 return b;
00090 }
00091
00092 inline G4ErrorSymMatrix::G4ErrorSymMatrix_row_const
00093 G4ErrorSymMatrix::operator[] (G4int r) const
00094 {
00095 const G4ErrorSymMatrix_row_const b(*this,r);
00096 return b;
00097 }
00098
00099 inline G4double &G4ErrorSymMatrix::G4ErrorSymMatrix_row::operator[](G4int c)
00100 {
00101 if (_r >= c )
00102 {
00103 return *(_a.m.begin() + (_r+1)*_r/2 + c);
00104 }
00105 else
00106 {
00107 return *(_a.m.begin() + (c+1)*c/2 + _r);
00108 }
00109 }
00110
00111 inline const G4double &
00112 G4ErrorSymMatrix::G4ErrorSymMatrix_row_const::operator[](G4int c) const
00113 {
00114 if (_r >= c )
00115 {
00116 return *(_a.m.begin() + (_r+1)*_r/2 + c);
00117 }
00118 else
00119 {
00120 return *(_a.m.begin() + (c+1)*c/2 + _r);
00121 }
00122 }
00123
00124 inline G4ErrorSymMatrix::
00125 G4ErrorSymMatrix_row::G4ErrorSymMatrix_row(G4ErrorSymMatrix &a, G4int r)
00126 : _a(a), _r(r)
00127 {}
00128
00129 inline G4ErrorSymMatrix::
00130 G4ErrorSymMatrix_row_const::G4ErrorSymMatrix_row_const
00131 (const G4ErrorSymMatrix&a,G4int r)
00132 : _a(a), _r(r)
00133 {}
00134
00135 inline G4ErrorSymMatrix G4ErrorSymMatrix::inverse(G4int &ifail) const
00136 {
00137 G4ErrorSymMatrix mTmp(*this);
00138 mTmp.invert(ifail);
00139 return mTmp;
00140 }