14 inline HepMatrix::HepMatrix()
15 : m(0), nrow(0), ncol(0), size_(0) {}
17 inline HepMatrix::HepMatrix_row HepMatrix::operator[] (
int r)
18 #ifdef HEP_GNU_OPTIMIZED_RETURN 23 HepMatrix_row b(*
this,r);
28 inline const HepMatrix::HepMatrix_row_const HepMatrix::operator[] (
int r)
const 29 #ifdef HEP_GNU_OPTIMIZED_RETURN 34 HepMatrix_row_const b(*
this,r);
39 inline double &HepMatrix::HepMatrix_row::operator[](
int c) {
40 #ifdef MATRIX_BOUND_CHECK 41 if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
42 HepGenMatrix::error(
"Range error in HepMatrix::operator[][]");
44 return *(_a.m.begin()+_r*_a.ncol+c);
47 inline const double &HepMatrix::HepMatrix_row_const::operator[](
int c)
const 49 #ifdef MATRIX_BOUND_CHECK 50 if (_r<0 || _r>=_a.num_row() || c<0 || c>=_a.num_col())
51 HepGenMatrix::error(
"Range error in HepMatrix::operator[][]");
53 return *(_a.m.begin()+_r*_a.ncol+c);
56 inline HepMatrix::HepMatrix_row::HepMatrix_row(HepMatrix&a,
int r)
61 inline HepMatrix::HepMatrix_row_const::HepMatrix_row_const
62 (
const HepMatrix&a,
int r)
69 inline void swap(HepMatrix &hm1,HepMatrix &hm2) {
78 HepMatrix HepMatrix::inverse(
int &ierr)
const 79 #ifdef HEP_GNU_OPTIMIZED_RETURN 84 HepMatrix mTmp(*
this);
90 inline HepMatrix HepMatrix::inverse()
const {
92 HepMatrix mt=inverse(ierr);
93 if (ierr)
throw std::runtime_error(
"Error in HepMatrix inversion");
97 inline void HepMatrix::invert() {
100 if (ierr)
throw std::runtime_error(
"Error in HepMatrix inversion");
void swap(HepMatrix &hm1, HepMatrix &hm2)