Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: G4ErrorMatrix.icc,v 1.2 2007/06/01 12:43:28 gcosmo Exp $ >> 27 // GEANT4 tag $Name: geant4-09-01-patch-03 $ 26 // 28 // 27 // ------------------------------------------- 29 // ------------------------------------------------------------ 28 // GEANT 4 class inline implementation 30 // GEANT 4 class inline implementation 29 // ------------------------------------------- 31 // ------------------------------------------------------------ 30 32 31 inline G4ErrorMatrix::G4ErrorMatrix() 33 inline G4ErrorMatrix::G4ErrorMatrix() 32 : m(0) << 34 : m(0), nrow(0), ncol(0), size(0) 33 , nrow(0) << 35 { 34 , ncol(0) << 36 } 35 , size(0) << 36 {} << 37 37 38 inline G4int G4ErrorMatrix::num_row() const { << 38 inline G4int G4ErrorMatrix::num_row() const >> 39 { >> 40 return nrow; >> 41 } 39 42 40 inline G4int G4ErrorMatrix::num_col() const { << 43 inline G4int G4ErrorMatrix::num_col() const >> 44 { >> 45 return ncol; >> 46 } 41 47 42 inline G4int G4ErrorMatrix::num_size() const { << 48 inline G4int G4ErrorMatrix::num_size() const >> 49 { >> 50 return size; >> 51 } 43 52 44 inline G4double& G4ErrorMatrix::operator()(G4i << 53 inline G4double & G4ErrorMatrix::operator()(G4int row, G4int col) 45 { 54 { 46 return *(m.begin() + (row - 1) * ncol + col << 55 return *(m.begin()+(row-1)*ncol+col-1); 47 } 56 } 48 57 49 inline const G4double& G4ErrorMatrix::operator << 58 inline const G4double & G4ErrorMatrix::operator()(G4int row, G4int col) const 50 { 59 { 51 return *(m.begin() + (row - 1) * ncol + col << 60 return *(m.begin()+(row-1)*ncol+col-1); 52 } 61 } 53 62 54 inline G4ErrorMatrix::G4ErrorMatrix_row G4Erro << 63 inline G4ErrorMatrix::G4ErrorMatrix_row G4ErrorMatrix::operator[] (G4int r) 55 { 64 { 56 G4ErrorMatrix_row b(*this, r); << 65 G4ErrorMatrix_row b(*this,r); 57 return b; 66 return b; 58 } 67 } 59 68 60 inline const G4ErrorMatrix::G4ErrorMatrix_row_ << 69 inline const G4ErrorMatrix::G4ErrorMatrix_row_const 61 G4int r) const << 70 G4ErrorMatrix::operator[] (G4int r) const 62 { 71 { 63 G4ErrorMatrix_row_const b(*this, r); << 72 G4ErrorMatrix_row_const b(*this,r); 64 return b; 73 return b; 65 } 74 } 66 75 67 inline G4double& G4ErrorMatrix::G4ErrorMatrix_ << 76 inline G4double &G4ErrorMatrix::G4ErrorMatrix_row::operator[](G4int c) 68 { 77 { 69 return *(_a.m.begin() + _r * _a.ncol + c); << 78 return *(_a.m.begin()+_r*_a.ncol+c); 70 } 79 } 71 80 72 inline const G4double& G4ErrorMatrix::G4ErrorM << 81 inline const G4double & 73 G4int c) const << 82 G4ErrorMatrix::G4ErrorMatrix_row_const::operator[](G4int c) const 74 { 83 { 75 return *(_a.m.begin() + _r * _a.ncol + c); << 84 return *(_a.m.begin()+_r*_a.ncol+c); 76 } 85 } 77 86 78 inline G4ErrorMatrix::G4ErrorMatrix_row::G4Err << 87 inline G4ErrorMatrix:: 79 << 88 G4ErrorMatrix_row::G4ErrorMatrix_row(G4ErrorMatrix&a, G4int r) 80 : _a(a) << 89 : _a(a) 81 { 90 { 82 _r = r; 91 _r = r; 83 } 92 } 84 93 85 inline G4ErrorMatrix::G4ErrorMatrix_row_const: << 94 inline G4ErrorMatrix::G4ErrorMatrix_row_const::G4ErrorMatrix_row_const 86 const G4ErrorMatrix& a, G4int r) << 95 (const G4ErrorMatrix&a, G4int r) 87 : _a(a) << 96 : _a(a) 88 { 97 { 89 _r = r; 98 _r = r; 90 } 99 } 91 100 92 inline G4ErrorMatrix G4ErrorMatrix::inverse(G4 << 101 inline G4ErrorMatrix G4ErrorMatrix::inverse(G4int &ierr) const 93 { 102 { 94 G4ErrorMatrix mTmp(*this); 103 G4ErrorMatrix mTmp(*this); 95 mTmp.invert(ierr); 104 mTmp.invert(ierr); 96 return mTmp; 105 return mTmp; 97 } 106 } 98 107