/usr/include/CLHEP/Matrix/Matrix.icc is in libclhep-dev 2.1.4.1+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | // -*- C++ -*-
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// This software written by Nobu Katayama and Mike Smyth, Cornell University.
//
// This is the definitions of the inline member functions of the
// HepMatrix class
//
#include <stdexcept>
namespace CLHEP {
inline HepMatrix::HepMatrix()
: m(0), nrow(0), ncol(0), size_(0) {}
inline HepMatrix::HepMatrix_row HepMatrix::operator[] (int r)
#ifdef HEP_GNU_OPTIMIZED_RETURN
return b(*this,r);
{
#else
{
HepMatrix_row b(*this,r);
#endif
return b;
}
inline const HepMatrix::HepMatrix_row_const HepMatrix::operator[] (int r) const
#ifdef HEP_GNU_OPTIMIZED_RETURN
return b(*this,r);
{
#else
{
HepMatrix_row_const b(*this,r);
#endif
return b;
}
inline double &HepMatrix::HepMatrix_row::operator[](int c) {
#ifdef MATRIX_BOUND_CHECK
if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
HepGenMatrix::error("Range error in HepMatrix::operator[][]");
#endif
return *(_a.m.begin()+_r*_a.ncol+c);
}
inline const double &HepMatrix::HepMatrix_row_const::operator[](int c) const
{
#ifdef MATRIX_BOUND_CHECK
if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
HepGenMatrix::error("Range error in HepMatrix::operator[][]");
#endif
return *(_a.m.begin()+_r*_a.ncol+c);
}
inline HepMatrix::HepMatrix_row::HepMatrix_row(HepMatrix&a,int r)
: _a(a) {
_r = r;
}
inline HepMatrix::HepMatrix_row_const::HepMatrix_row_const
(const HepMatrix&a, int r)
: _a(a)
{
_r = r;
}
// This function swaps two Matrices without doing a full copy.
inline void swap(HepMatrix &hm1,HepMatrix &hm2) {
HepGenMatrix::swap(hm1.m,hm2.m);
/*** commented
HepGenMatrix::swap(hm1.nrow,hm2.nrow);
HepGenMatrix::swap(hm1.ncol,hm2.ncol);
HepGenMatrix::swap(hm1.size_,hm2.size_);
*/
}
/*-ap inline */ HepMatrix HepMatrix::inverse(int &ierr) const
#ifdef HEP_GNU_OPTIMIZED_RETURN
return mTmp(*this);
{
#else
{
HepMatrix mTmp(*this);
#endif
mTmp.invert(ierr);
return mTmp;
}
inline HepMatrix HepMatrix::inverse() const {
int ierr;
HepMatrix mt=inverse(ierr);
if (ierr) throw std::runtime_error("Error in HepMatrix inversion");
return mt;
}
inline void HepMatrix::invert() {
int ierr;
invert(ierr);
if (ierr) throw std::runtime_error("Error in HepMatrix inversion");
}
} // namespace CLHEP
|