CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
GenMatrix.icc
Go to the documentation of this file.
1// -*- C++ -*-
2// ---------------------------------------------------------------------------
3//
4// This file is a part of the CLHEP - a Class Library for High Energy Physics.
5//
6// This software written by Nobu Katayama and Mike Smyth, Cornell University.
7//
8
9namespace CLHEP {
10
11// swap
12//
13inline void HepGenMatrix::swap(int &i,int &j) {int t=i;i=j;j=t;}
14#ifdef DISABLE_ALLOC
15inline void HepGenMatrix::swap(std::vector<double >& i, std::vector<double >& j) {
16 std::vector<double > t=i;i=j;j=t;
17}
18#else
19inline void HepGenMatrix::swap(std::vector<double,Alloc<double,25> >& i, std::vector<double,Alloc<double,25> >& j) {
20 std::vector<double,Alloc<double,25> > t=i;i=j;j=t;
21}
22#endif
23
24//
25// operator [] (I cannot make it virtual because return types are different.)
26// Therefore I will have to use the virtual operator (,).
27//
29 return _a(_r+1,c+1);
30}
31
33operator[](int c) const {
34 return _a(_r+1,c+1);
35}
36
38 HepGenMatrix_row b(*this,r);
39 return b;
40}
41
43operator[](int r) const{
44 HepGenMatrix_row_const b(*this,r);
45 return b;
46}
47
49: _a(a) {
50 _r = r;
51}
52
55 : _a(a) {
56 _r = r;
57}
58
59
60} // namespace CLHEP
61
62
63// -----------------------------------------------------------------
64
65
HepGenMatrix_row_const(const HepGenMatrix &, int)
Definition GenMatrix.icc:54
HepGenMatrix_row(HepGenMatrix &, int)
Definition GenMatrix.icc:48
HepGenMatrix_row operator[](int)
Definition GenMatrix.icc:37
static void swap(int &, int &)
Definition GenMatrix.icc:13