G4ErrorSymMatrix.icc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id: G4ErrorSymMatrix.icc 69766 2013-05-14 14:33:55Z gcosmo $
00027 //
00028 // ------------------------------------------------------------
00029 //      GEANT 4 class inline implementation
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 }

Generated on Mon May 27 17:48:12 2013 for Geant4 by  doxygen 1.4.7