Files
geant4/source/error_propagation/include/G4ErrorMatrix.icc
T
2021-06-25 16:12:29 +02:00

98 lines
3.3 KiB
Plaintext

//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// ------------------------------------------------------------
// GEANT 4 class inline implementation
// ------------------------------------------------------------
inline G4ErrorMatrix::G4ErrorMatrix()
: m(0)
, nrow(0)
, ncol(0)
, size(0)
{}
inline G4int G4ErrorMatrix::num_row() const { return nrow; }
inline G4int G4ErrorMatrix::num_col() const { return ncol; }
inline G4int G4ErrorMatrix::num_size() const { return size; }
inline G4double& G4ErrorMatrix::operator()(G4int row, G4int col)
{
return *(m.begin() + (row - 1) * ncol + col - 1);
}
inline const G4double& G4ErrorMatrix::operator()(G4int row, G4int col) const
{
return *(m.begin() + (row - 1) * ncol + col - 1);
}
inline G4ErrorMatrix::G4ErrorMatrix_row G4ErrorMatrix::operator[](G4int r)
{
G4ErrorMatrix_row b(*this, r);
return b;
}
inline const G4ErrorMatrix::G4ErrorMatrix_row_const G4ErrorMatrix::operator[](
G4int r) const
{
G4ErrorMatrix_row_const b(*this, r);
return b;
}
inline G4double& G4ErrorMatrix::G4ErrorMatrix_row::operator[](G4int c)
{
return *(_a.m.begin() + _r * _a.ncol + c);
}
inline const G4double& G4ErrorMatrix::G4ErrorMatrix_row_const::operator[](
G4int c) const
{
return *(_a.m.begin() + _r * _a.ncol + c);
}
inline G4ErrorMatrix::G4ErrorMatrix_row::G4ErrorMatrix_row(G4ErrorMatrix& a,
G4int r)
: _a(a)
{
_r = r;
}
inline G4ErrorMatrix::G4ErrorMatrix_row_const::G4ErrorMatrix_row_const(
const G4ErrorMatrix& a, G4int r)
: _a(a)
{
_r = r;
}
inline G4ErrorMatrix G4ErrorMatrix::inverse(G4int& ierr) const
{
G4ErrorMatrix mTmp(*this);
mTmp.invert(ierr);
return mTmp;
}