Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:14

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // ------------------------------------------------------------
0028 //      GEANT 4 class inline implementation
0029 // ------------------------------------------------------------
0030 
0031 inline G4ErrorMatrix::G4ErrorMatrix()
0032   : m(0)
0033   , nrow(0)
0034   , ncol(0)
0035   , size(0)
0036 {}
0037 
0038 inline G4int G4ErrorMatrix::num_row() const { return nrow; }
0039 
0040 inline G4int G4ErrorMatrix::num_col() const { return ncol; }
0041 
0042 inline G4int G4ErrorMatrix::num_size() const { return size; }
0043 
0044 inline G4double& G4ErrorMatrix::operator()(G4int row, G4int col)
0045 {
0046   return *(m.begin() + (row - 1) * ncol + col - 1);
0047 }
0048 
0049 inline const G4double& G4ErrorMatrix::operator()(G4int row, G4int col) const
0050 {
0051   return *(m.begin() + (row - 1) * ncol + col - 1);
0052 }
0053 
0054 inline G4ErrorMatrix::G4ErrorMatrix_row G4ErrorMatrix::operator[](G4int r)
0055 {
0056   G4ErrorMatrix_row b(*this, r);
0057   return b;
0058 }
0059 
0060 inline const G4ErrorMatrix::G4ErrorMatrix_row_const G4ErrorMatrix::operator[](
0061   G4int r) const
0062 {
0063   G4ErrorMatrix_row_const b(*this, r);
0064   return b;
0065 }
0066 
0067 inline G4double& G4ErrorMatrix::G4ErrorMatrix_row::operator[](G4int c)
0068 {
0069   return *(_a.m.begin() + _r * _a.ncol + c);
0070 }
0071 
0072 inline const G4double& G4ErrorMatrix::G4ErrorMatrix_row_const::operator[](
0073   G4int c) const
0074 {
0075   return *(_a.m.begin() + _r * _a.ncol + c);
0076 }
0077 
0078 inline G4ErrorMatrix::G4ErrorMatrix_row::G4ErrorMatrix_row(G4ErrorMatrix& a,
0079                                                            G4int r)
0080   : _a(a)
0081 {
0082   _r = r;
0083 }
0084 
0085 inline G4ErrorMatrix::G4ErrorMatrix_row_const::G4ErrorMatrix_row_const(
0086   const G4ErrorMatrix& a, G4int r)
0087   : _a(a)
0088 {
0089   _r = r;
0090 }
0091 
0092 inline G4ErrorMatrix G4ErrorMatrix::inverse(G4int& ierr) const
0093 {
0094   G4ErrorMatrix mTmp(*this);
0095   mTmp.invert(ierr);
0096   return mTmp;
0097 }