CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  do_nothing_deleter
 
class  DoubConv
 
class  DoubConvException
 
class  DRand48Engine
 
class  DualRand
 
class  EngineFactory
 
class  Hep2Vector
 
class  Hep3RotationInterface
 
class  Hep3Vector
 
class  Hep4RotationInterface
 
class  HepAxisAngle
 
class  HepBoost
 
class  HepBoostX
 
class  HepBoostY
 
class  HepBoostZ
 
class  HepDiagMatrix
 
class  HepEulerAngles
 
class  HepGenMatrix
 
class  HepJamesRandom
 
class  HepLorentzRotation
 
class  HepLorentzVector
 
class  HepMatrix
 
class  HepPile
 
class  HepRandom
 
class  HepRandomEngine
 
class  HepRandomVector
 
struct  HepRep3x3
 
struct  HepRep4x4
 
struct  HepRep4x4Symmetric
 
class  HepRotation
 
class  HepRotationX
 
class  HepRotationY
 
class  HepRotationZ
 
class  HepStat
 
class  HepSymMatrix
 
class  HepVector
 
class  Hurd160Engine
 
class  Hurd288Engine
 
class  MixMaxRng
 
class  MTwistEngine
 
class  noncopyable
 
class  NonRandomEngine
 
class  RandBinomial
 
class  RandBit
 
class  RandBreitWigner
 
class  RandChiSquare
 
class  RandEngine
 
struct  RandEngineBuilder
 
struct  RandEngineBuilder< 2147483647 >
 
struct  RandEngineBuilder< 32767 >
 
class  RandExponential
 
class  RandExpZiggurat
 
class  RandFlat
 
class  RandGamma
 
class  RandGauss
 
class  RandGaussQ
 
class  RandGaussT
 
class  RandGaussZiggurat
 
class  RandGeneral
 
class  RandLandau
 
class  RandMultiGauss
 
class  RandPoisson
 
class  RandPoissonQ
 
class  RandPoissonT
 
class  RandSkewNormal
 
class  RandStudentT
 
class  RanecuEngine
 
class  Ranlux64Engine
 
class  RanluxEngine
 
class  RanluxppEngine
 
class  RanshiEngine
 
class  StaticRandomStates
 
class  Tcomponent
 
class  TripleRand
 

Typedefs

using myID_t = std::uint32_t
 
using myuint_t = unsigned long long int
 
template<typename T >
using shared_ptr = std::shared_ptr< T >
 
template<typename T >
using weak_ptr = std::weak_ptr< T >
 
typedef HepLorentzVector HepLorentzVectorD
 
typedef HepLorentzVector HepLorentzVectorF
 
typedef Hep3Vector HepThreeVectorD
 
typedef Hep3Vector HepThreeVectorF
 

Enumerations

enum  ZMpvMetric_t { TimePositive , TimeNegative }
 

Functions

std::ostream & operator<< (std::ostream &s, const HepDiagMatrix &q)
 
HepMatrix operator* (const HepMatrix &hm1, const HepDiagMatrix &hm2)
 
HepMatrix operator* (const HepDiagMatrix &hm1, const HepMatrix &hm2)
 
HepDiagMatrix operator* (double t, const HepDiagMatrix &d1)
 
HepDiagMatrix operator* (const HepDiagMatrix &d1, double t)
 
HepDiagMatrix operator/ (const HepDiagMatrix &hm1, double t)
 
HepMatrix operator+ (const HepMatrix &hm1, const HepDiagMatrix &d2)
 
HepMatrix operator+ (const HepDiagMatrix &d1, const HepMatrix &hm2)
 
HepDiagMatrix operator+ (const HepDiagMatrix &hm1, const HepDiagMatrix &d2)
 
HepSymMatrix operator+ (const HepSymMatrix &s1, const HepDiagMatrix &d2)
 
HepSymMatrix operator+ (const HepDiagMatrix &d1, const HepSymMatrix &s2)
 
HepMatrix operator- (const HepMatrix &hm1, const HepDiagMatrix &d2)
 
HepMatrix operator- (const HepDiagMatrix &d1, const HepMatrix &hm2)
 
HepDiagMatrix operator- (const HepDiagMatrix &d1, const HepDiagMatrix &d2)
 
HepSymMatrix operator- (const HepSymMatrix &s1, const HepDiagMatrix &d2)
 
HepSymMatrix operator- (const HepDiagMatrix &d1, const HepSymMatrix &s2)
 
HepDiagMatrix dsum (const HepDiagMatrix &s1, const HepDiagMatrix &s2)
 
double norm (const HepGenMatrix &m)
 
double norm1 (const HepGenMatrix &m)
 
double norm_infinity (const HepGenMatrix &m)
 
HepMatrix operator* (const HepMatrix &, const HepMatrix &)
 
HepMatrix operator* (double t, const HepMatrix &)
 
HepMatrix operator* (const HepMatrix &, double)
 
HepMatrix operator/ (const HepMatrix &, double)
 
HepMatrix operator+ (const HepMatrix &hm1, const HepMatrix &hm2)
 
HepMatrix operator- (const HepMatrix &hm1, const HepMatrix &hm2)
 
HepMatrix dsum (const HepMatrix &, const HepMatrix &)
 
HepVector solve (const HepMatrix &, const HepVector &)
 
std::ostream & operator<< (std::ostream &s, const HepMatrix &q)
 
HepVector qr_solve (const HepMatrix &A, const HepVector &b)
 
HepVector qr_solve (HepMatrix *A, const HepVector &b)
 
HepMatrix qr_solve (const HepMatrix &A, const HepMatrix &b)
 
HepMatrix qr_solve (HepMatrix *A, const HepMatrix &b)
 
HepMatrix qr_inverse (const HepMatrix &A)
 
HepMatrix qr_inverse (HepMatrix *A)
 
void qr_decomp (HepMatrix *A, HepMatrix *hsm)
 
HepMatrix qr_decomp (HepMatrix *A)
 
void back_solve (const HepMatrix &R, HepVector *b)
 
void back_solve (const HepMatrix &R, HepMatrix *b)
 
void col_house (HepMatrix *a, const HepMatrix &v, double vnormsq, int row, int col, int row_start, int col_start)
 
void col_house (HepMatrix *a, const HepMatrix &v, int row, int col, int row_start, int col_start)
 
void col_givens (HepMatrix *A, double c, double s, int k1, int k2, int row_min=1, int row_max=0)
 
void row_givens (HepMatrix *A, double c, double s, int k1, int k2, int col_min=1, int col_max=0)
 
void givens (double a, double b, double *c, double *s)
 
HepVector house (const HepMatrix &a, int row=1, int col=1)
 
void house_with_update (HepMatrix *a, int row=1, int col=1)
 
void house_with_update (HepMatrix *a, HepMatrix *v, int row=1, int col=1)
 
void row_house (HepMatrix *a, const HepVector &v, double vnormsq, int row=1, int col=1)
 
void row_house (HepMatrix *a, const HepMatrix &v, double vnormsq, int row, int col, int row_start, int col_start)
 
void row_house (HepMatrix *a, const HepMatrix &v, int row, int col, int row_start, int col_start)
 
std::ostream & operator<< (std::ostream &s, const HepSymMatrix &q)
 
HepMatrix operator* (const HepMatrix &hm1, const HepSymMatrix &hm2)
 
HepMatrix operator* (const HepSymMatrix &hm1, const HepMatrix &hm2)
 
HepMatrix operator* (const HepSymMatrix &hm1, const HepSymMatrix &hm2)
 
HepSymMatrix operator* (double t, const HepSymMatrix &s1)
 
HepSymMatrix operator* (const HepSymMatrix &s1, double t)
 
HepSymMatrix operator/ (const HepSymMatrix &hm1, double t)
 
HepMatrix operator+ (const HepMatrix &hm1, const HepSymMatrix &s2)
 
HepMatrix operator+ (const HepSymMatrix &s1, const HepMatrix &hm2)
 
HepSymMatrix operator+ (const HepSymMatrix &s1, const HepSymMatrix &s2)
 
HepMatrix operator- (const HepMatrix &hm1, const HepSymMatrix &s2)
 
HepMatrix operator- (const HepSymMatrix &hm1, const HepMatrix &hm2)
 
HepSymMatrix operator- (const HepSymMatrix &s1, const HepSymMatrix &s2)
 
HepSymMatrix dsum (const HepSymMatrix &s1, const HepSymMatrix &s2)
 
double condition (const HepSymMatrix &m)
 
void diag_step (HepSymMatrix *t, int begin, int end)
 
void diag_step (HepSymMatrix *t, HepMatrix *u, int begin, int end)
 
HepMatrix diagonalize (HepSymMatrix *s)
 
HepVector house (const HepSymMatrix &a, int row=1, int col=1)
 
void house_with_update2 (HepSymMatrix *a, HepMatrix *v, int row=1, int col=1)
 
void tridiagonal (HepSymMatrix *a, HepMatrix *hsm)
 
HepMatrix tridiagonal (HepSymMatrix *a)
 
std::ostream & operator<< (std::ostream &s, const HepVector &v)
 
HepVector operator* (const HepMatrix &hm1, const HepVector &hm2)
 
HepVector operator* (double t, const HepVector &v1)
 
HepVector operator* (const HepVector &v1, double t)
 
HepVector operator/ (const HepVector &v1, double t)
 
HepVector operator+ (const HepMatrix &hm1, const HepVector &v2)
 
HepVector operator+ (const HepVector &v1, const HepMatrix &hm2)
 
HepVector operator+ (const HepVector &v1, const HepVector &v2)
 
HepVector operator- (const HepMatrix &hm1, const HepVector &v2)
 
HepVector operator- (const HepVector &v1, const HepMatrix &hm2)
 
HepVector operator- (const HepVector &v1, const HepVector &v2)
 
HepVector dsum (const HepVector &s1, const HepVector &s2)
 
HepDiagMatrix operator* (const HepDiagMatrix &hm1, const HepDiagMatrix &hm2)
 
HepVector operator* (const HepDiagMatrix &hm1, const HepVector &hm2)
 
HepVector min_line_dist (const HepVector *const A, const HepVector *const B, int n)
 
HepVector operator* (const HepSymMatrix &hm1, const HepVector &hm2)
 
HepSymMatrix vT_times_v (const HepVector &v)
 
HepMatrix operator* (const HepVector &hm1, const HepMatrix &hm2)
 
double dot (const HepVector &v1, const HepVector &v2)
 
unsigned long crc32ul (const std::string &s)
 
template<class E >
unsigned long engineIDulong ()
 
std::ostream & operator<< (std::ostream &os, const HepRandom &dist)
 
std::istream & operator>> (std::istream &is, HepRandom &dist)
 
std::ostream & operator<< (std::ostream &os, const HepRandomEngine &e)
 
std::istream & operator>> (std::istream &is, HepRandomEngine &e)
 
template<class IS , class T >
bool possibleKeywordInput (IS &is, const std::string &key, T &t)
 
double transformSmall (double r)
 
double gammln (double xx)
 
std::ostream & operator<< (std::ostream &os, const HepAxisAngle &aa)
 
void ZMinputAxisAngle (std::istream &is, double &x, double &y, double &z, double &delta)
 
std::istream & operator>> (std::istream &is, HepAxisAngle &aa)
 
std::ostream & operator<< (std::ostream &os, const HepEulerAngles &ea)
 
void ZMinput3doubles (std::istream &is, const char *type, double &x, double &y, double &z)
 
std::istream & operator>> (std::istream &is, HepEulerAngles &ea)
 
HepLorentzRotation operator* (const HepRotation &r, const HepLorentzRotation &lt)
 
std::ostream & operator<< (std::ostream &os, const HepLorentzVector &v1)
 
std::istream & operator>> (std::istream &is, HepLorentzVector &v1)
 
HepLorentzVector operator/ (const HepLorentzVector &w, double c)
 
HepLorentzVector rotationXOf (const HepLorentzVector &vec, double phi)
 
HepLorentzVector rotationYOf (const HepLorentzVector &vec, double phi)
 
HepLorentzVector rotationZOf (const HepLorentzVector &vec, double phi)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const Hep3Vector &aaxis, double ddelta)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepAxisAngle &ax)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepEulerAngles &e1)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, double phi1, double theta1, double psi1)
 
Hep3Vector rotationOf (const Hep3Vector &vec, const HepAxisAngle &ax)
 
Hep3Vector rotationOf (const Hep3Vector &vec, const Hep3Vector &axis, double ddelta)
 
Hep3Vector rotationOf (const Hep3Vector &vec, const HepEulerAngles &ex)
 
Hep3Vector rotationOf (const Hep3Vector &vec, double phi, double theta, double psi)
 
Hep3Vector rotationXOf (const Hep3Vector &vec, double ddelta)
 
Hep3Vector rotationYOf (const Hep3Vector &vec, double ddelta)
 
Hep3Vector rotationZOf (const Hep3Vector &vec, double ddelta)
 
std::ostream & operator<< (std::ostream &os, const Hep3Vector &v)
 
std::istream & operator>> (std::istream &is, Hep3Vector &v)
 
Hep3Vector operator/ (const Hep3Vector &v1, double c)
 
Hep2Vector operator/ (const Hep2Vector &p, double a)
 
std::ostream & operator<< (std::ostream &os, const Hep2Vector &q)
 
void ZMinput2doubles (std::istream &is, const char *type, double &x, double &y)
 
std::istream & operator>> (std::istream &is, Hep2Vector &p)
 
HepBoost inverseOf (const HepBoost &lt)
 
std::ostream & operator<< (std::ostream &os, const HepBoost &b)
 
HepBoostX inverseOf (const HepBoostX &b)
 
std::ostream & operator<< (std::ostream &os, const HepBoostX &b)
 
HepBoostY inverseOf (const HepBoostY &b)
 
std::ostream & operator<< (std::ostream &os, const HepBoostY &b)
 
HepBoostZ inverseOf (const HepBoostZ &b)
 
std::ostream & operator<< (std::ostream &os, const HepBoostZ &b)
 
HepLorentzRotation inverseOf (const HepLorentzRotation &lt)
 
HepLorentzRotation operator* (const HepRotationX &r, const HepLorentzRotation &lt)
 
HepLorentzRotation operator* (const HepRotationY &r, const HepLorentzRotation &lt)
 
HepLorentzRotation operator* (const HepRotationZ &r, const HepLorentzRotation &lt)
 
std::ostream & operator<< (std::ostream &os, const HepLorentzRotation &lt)
 
bool operator== (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator!= (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator<= (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator>= (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator< (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator> (const HepRotation &r, const HepLorentzRotation &lt)
 
bool operator== (const HepBoost &b, const HepLorentzRotation &lt)
 
bool operator!= (const HepBoost &b, const HepLorentzRotation &lt)
 
bool operator<= (const HepBoost &b, const HepLorentzRotation &lt)
 
bool operator>= (const HepBoost &b, const HepLorentzRotation &lt)
 
bool operator< (const HepBoost &b, const HepLorentzRotation &lt)
 
bool operator> (const HepBoost &b, const HepLorentzRotation &lt)
 
HepLorentzVector boostXOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostYOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostZOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &betaVector)
 
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &axis, double beta)
 
HepLorentzVector operator* (const HepLorentzVector &, double a)
 
HepLorentzVector operator* (double a, const HepLorentzVector &)
 
HepRotation inverseOf (const HepRotation &r)
 
HepRotation operator* (const HepRotationX &rx, const HepRotation &r)
 
HepRotation operator* (const HepRotationY &ry, const HepRotation &r)
 
HepRotation operator* (const HepRotationZ &rz, const HepRotation &r)
 
std::ostream & operator<< (std::ostream &os, const HepRotation &r)
 
HepRotationX inverseOf (const HepRotationX &r)
 
std::ostream & operator<< (std::ostream &os, const HepRotationX &r)
 
HepRotationY inverseOf (const HepRotationY &r)
 
std::ostream & operator<< (std::ostream &os, const HepRotationY &r)
 
HepRotationZ inverseOf (const HepRotationZ &r)
 
std::ostream & operator<< (std::ostream &os, const HepRotationZ &r)
 
Hep3Vector operator+ (const Hep3Vector &, const Hep3Vector &)
 
Hep3Vector operator- (const Hep3Vector &, const Hep3Vector &)
 
double operator* (const Hep3Vector &, const Hep3Vector &)
 
Hep3Vector operator* (const Hep3Vector &, double a)
 
Hep3Vector operator* (double a, const Hep3Vector &)
 
double operator* (const Hep2Vector &a, const Hep2Vector &b)
 
Hep2Vector operator* (const Hep2Vector &p, double a)
 
Hep2Vector operator* (double a, const Hep2Vector &p)
 
Hep2Vector operator+ (const Hep2Vector &a, const Hep2Vector &b)
 
Hep2Vector operator- (const Hep2Vector &a, const Hep2Vector &b)
 

Variables

const Hep3Vector HepXHat (1.0, 0.0, 0.0)
 
const Hep3Vector HepYHat (0.0, 1.0, 0.0)
 
const Hep3Vector HepZHat (0.0, 0.0, 1.0)
 

Detailed Description

Author

Typedef Documentation

◆ HepLorentzVectorD

Definition at line 548 of file LorentzVector.h.

◆ HepLorentzVectorF

Definition at line 549 of file LorentzVector.h.

◆ HepThreeVectorD

Definition at line 421 of file ThreeVector.h.

◆ HepThreeVectorF

Definition at line 422 of file ThreeVector.h.

◆ myID_t

using CLHEP::myID_t = typedef std::uint32_t
Author
K.Savvidy

Definition at line 48 of file MixMaxRng.h.

◆ myuint_t

using CLHEP::myuint_t = typedef unsigned long long int

Definition at line 49 of file MixMaxRng.h.

◆ shared_ptr

template<typename T >
using CLHEP::shared_ptr = typedef std::shared_ptr<T>

Definition at line 17 of file memory.h.

◆ weak_ptr

template<typename T >
using CLHEP::weak_ptr = typedef std::weak_ptr<T>

Definition at line 19 of file memory.h.

Enumeration Type Documentation

◆ ZMpvMetric_t

Enumerator
TimePositive 
TimeNegative 

Definition at line 61 of file LorentzVector.h.

Function Documentation

◆ back_solve() [1/2]

void CLHEP::back_solve ( const HepMatrix R,
HepMatrix b 
)

Definition at line 90 of file MatrixLinear.cc.

91{
92 int n = R.num_col();
93 int nb = b->num_row();
94 int nc = b->num_col();
95 HepMatrix::mIter bbi = b->m.begin() + (nb - 2) * nc;
96 for (int i=1;i<=b->num_col();i++) {
97 (*b)(b->num_row(),i) /= R(b->num_row(),b->num_row());
98 HepMatrix::mcIter Rrr = R.m.begin() + (nb-2) * (n+1);
99 HepMatrix::mIter bri = bbi;
100 for (int r=b->num_row()-1;r>=1;--r) {
101 HepMatrix::mIter bci = bri + nc;
102 HepMatrix::mcIter Rrc = Rrr+1;
103 for (int c=r+1;c<=b->num_row();c++) {
104 (*bri)-= (*(Rrc++)) * (*bci);
105 if(c<b->num_row()) bci += nc;
106 }
107 (*bri)/= (*Rrr);
108 if(r>1) {
109 Rrr -= (n+1);
110 bri -= nc;
111 }
112 }
113 bbi++;
114 }
115}
std::vector< double, Alloc< double, 25 > >::const_iterator mcIter
Definition: GenMatrix.h:74
std::vector< double, Alloc< double, 25 > >::iterator mIter
Definition: GenMatrix.h:73
virtual int num_col() const
Definition: Matrix.cc:120
virtual int num_row() const
Definition: Matrix.cc:118

◆ back_solve() [2/2]

void CLHEP::back_solve ( const HepMatrix R,
HepVector b 
)

Definition at line 63 of file MatrixLinear.cc.

64{
65 (*b)(b->num_row()) /= R(b->num_row(),b->num_row());
66 int n = R.num_col();
67 int nb = b->num_row();
68 HepMatrix::mIter br = b->m.begin() + b->num_row() - 2;
69 HepMatrix::mcIter Rrr = R.m.begin() + (nb-2) * (n+1);
70 for (int r=b->num_row()-1;r>=1;--r) {
71 HepMatrix::mIter bc = br+1;
72 HepMatrix::mcIter Rrc = Rrr+1;
73 for (int c=r+1;c<=b->num_row();c++) {
74 (*br)-=(*(Rrc++))*(*(bc++));
75 }
76 (*br)/=(*Rrr);
77 if(r>1) {
78 br--;
79 Rrr -= n+1;
80 }
81 }
82}
virtual int num_row() const
Definition: Vector.cc:116

Referenced by qr_inverse().

◆ boostOf() [1/2]

HepLorentzVector CLHEP::boostOf ( const HepLorentzVector vec,
const Hep3Vector axis,
double  beta 
)
inline

◆ boostOf() [2/2]

HepLorentzVector CLHEP::boostOf ( const HepLorentzVector vec,
const Hep3Vector betaVector 
)
inline

◆ boostXOf()

HepLorentzVector CLHEP::boostXOf ( const HepLorentzVector vec,
double  beta 
)
inline

◆ boostYOf()

HepLorentzVector CLHEP::boostYOf ( const HepLorentzVector vec,
double  beta 
)
inline

◆ boostZOf()

HepLorentzVector CLHEP::boostZOf ( const HepLorentzVector vec,
double  beta 
)
inline

◆ col_givens()

void CLHEP::col_givens ( HepMatrix A,
double  c,
double  s,
int  k1,
int  k2,
int  row_min = 1,
int  row_max = 0 
)

Definition at line 124 of file MatrixLinear.cc.

125 {
126 if (row_max<=0) row_max = A->num_row();
127 int n = A->num_col();
128 HepMatrix::mIter Ajk1 = A->m.begin() + (row_min - 1) * n + k1 - 1;
129 HepMatrix::mIter Ajk2 = A->m.begin() + (row_min - 1) * n + k2 - 1;
130 for (int j=row_min;j<=row_max;j++) {
131 double tau1=(*Ajk1); double tau2=(*Ajk2);
132 (*Ajk1)=c*tau1-ds*tau2;(*Ajk2)=ds*tau1+c*tau2;
133 if(j<row_max) {
134 Ajk1 += n;
135 Ajk2 += n;
136 }
137 }
138}

◆ col_house() [1/2]

void CLHEP::col_house ( HepMatrix a,
const HepMatrix v,
double  vnormsq,
int  row,
int  col,
int  row_start,
int  col_start 
)

Definition at line 154 of file MatrixLinear.cc.

155 {
156 double beta=-2/vnormsq;
157
158 // This is a fast way of calculating w=beta*A.sub(row,n,col,n)*v
159
160 HepVector w(a->num_col()-col+1,0);
161/* not tested */
162 HepMatrix::mIter wptr = w.m.begin();
163 int n = a->num_col();
164 int nv = v.num_col();
165 HepMatrix::mIter acrb = a->m.begin() + (col-1) * n + (row-1);
166 int c;
167 for (c=col;c<=a->num_col();c++) {
168 HepMatrix::mcIter vp = v.m.begin() + (row_start-1) * nv + (col_start-1);
169 HepMatrix::mcIter acr = acrb;
170 for (int r=row;r<=a->num_row();r++) {
171 (*wptr)+=(*(acr++))*(*vp);
172 vp += nv;
173 }
174 wptr++;
175 if(c<a->num_col()) acrb += n;
176 }
177 w*=beta;
178
179 // Fast way of calculating A.sub=A.sub+w*v.T()
180
181 HepMatrix::mIter arcb = a->m.begin() + (row-1) * n + col-1;
182 wptr = w.m.begin();
183 for (int r=row; r<=a->num_row();r++) {
184 HepMatrix::mIter arc = arcb;
185 HepMatrix::mcIter vp = v.m.begin() + (row_start-1) * nv + col_start;
186 for (c=col;c<=a->num_col();c++) {
187 (*(arc++))+=(*vp)*(*wptr);
188 vp += nv;
189 }
190 wptr++;
191 if(r<a->num_row()) arcb += n;
192 }
193}

Referenced by col_house().

◆ col_house() [2/2]

void CLHEP::col_house ( HepMatrix a,
const HepMatrix v,
int  row,
int  col,
int  row_start,
int  col_start 
)

Definition at line 873 of file MatrixLinear.cc.

875{
876 double normsq=0;
877 for (int i=row_start;i<=row_start+a->num_row()-row;i++)
878 normsq+=v(i,col)*v(i,col);
879 col_house(a,v,normsq,row,col,row_start,col_start);
880}
void col_house(HepMatrix *a, const HepMatrix &v, double vnormsq, int row, int col, int row_start, int col_start)

◆ condition()

double CLHEP::condition ( const HepSymMatrix m)

Definition at line 201 of file MatrixLinear.cc.

202{
203 HepSymMatrix mcopy=hm;
204 diagonalize(&mcopy);
205 double max,min;
206 max=min=fabs(mcopy(1,1));
207
208 int n = mcopy.num_row();
209 HepMatrix::mIter mii = mcopy.m.begin() + 2;
210 for (int i=2; i<=n; i++) {
211 if (max<fabs(*mii)) max=fabs(*mii);
212 if (min>fabs(*mii)) min=fabs(*mii);
213 if(i<n) mii += i+1;
214 }
215 return max/min;
216}
int num_row() const
HepMatrix diagonalize(HepSymMatrix *s)

Referenced by main().

◆ crc32ul()

unsigned long CLHEP::crc32ul ( const std::string &  s)

Definition at line 37 of file engineIDulong.cc.

37 {
38 static const std::vector<unsigned long> crc_table = gen_crc_table();
39 unsigned long crc = 0;
40 unsigned long end = s.length();
41 for (unsigned long j = 0; j != end; ++j) {
42 int i = ( (int) ( crc >> 24) ^ s[j] ) & 0xff;
43 crc = ( ( crc << 8 ) ^ crc_table[i] ) & 0xffffffffUL;
44 }
45 return crc;
46}

Referenced by engineIDulong().

◆ diag_step() [1/2]

void CLHEP::diag_step ( HepSymMatrix t,
HepMatrix u,
int  begin,
int  end 
)

Definition at line 270 of file MatrixLinear.cc.

271{
272 double d=(t->fast(end-1,end-1)-t->fast(end,end))/2;
273 double mu=t->fast(end,end)-t->fast(end,end-1)*t->fast(end,end-1)/
274 (d+sign(d)*sqrt(d*d+ t->fast(end,end-1)*t->fast(end,end-1)));
275 double x=t->fast(begin,begin)-mu;
276 double z=t->fast(begin+1,begin);
277 HepMatrix::mIter tkk = t->m.begin() + (begin+2)*(begin-1)/2;
278 HepMatrix::mIter tkp1k = tkk + begin;
279 HepMatrix::mIter tkp2k = tkk + 2 * begin + 1;
280 for (int k=begin;k<=end-1;k++) {
281 double c,ds;
282 givens(x,z,&c,&ds);
283 col_givens(u,c,ds,k,k+1);
284
285 // This is the result of G.T*t*G, making use of the special structure
286 // of t and G. Note that since t is symmetric, only the lower half
287 // needs to be updated. Equations were gotten from maple.
288
289 if (k!=begin) {
290 *(tkk-1)= (*(tkk-1))*c-(*(tkp1k-1))*ds;
291 *(tkp1k-1)=0;
292 }
293 double ap=(*tkk);
294 double bp=(*tkp1k);
295 double aq=(*(tkp1k+1));
296 (*tkk)=ap*c*c-2*c*bp*ds+aq*ds*ds;
297 (*tkp1k)=c*ap*ds+bp*c*c-bp*ds*ds-ds*aq*c;
298 (*(tkp1k+1))=ap*ds*ds+2*c*bp*ds+aq*c*c;
299 if (k<end-1) {
300 double bq=(*(tkp2k+1));
301 (*tkp2k)=-bq*ds;
302 (*(tkp2k+1))=bq*c;
303 x=(*tkp1k);
304 z=(*(tkp2k));
305 tkk += k+1;
306 tkp1k += k+2;
307 }
308 if(k<end-2) tkp2k += k+3;
309 }
310}
const double & fast(int row, int col) const
void givens(double a, double b, double *c, double *s)
void col_givens(HepMatrix *A, double c, double s, int k1, int k2, int row_min=1, int row_max=0)

◆ diag_step() [2/2]

void CLHEP::diag_step ( HepSymMatrix t,
int  begin,
int  end 
)

Definition at line 227 of file MatrixLinear.cc.

228{
229 double d=(t->fast(end-1,end-1)-t->fast(end,end))/2;
230 double mu=t->fast(end,end)-t->fast(end,end-1)*t->fast(end,end-1)/
231 (d+sign(d)*sqrt(d*d+ t->fast(end,end-1)*t->fast(end,end-1)));
232 double x=t->fast(begin,begin)-mu;
233 double z=t->fast(begin+1,begin);
234 HepMatrix::mIter tkk = t->m.begin() + (begin+2)*(begin-1)/2;
235 HepMatrix::mIter tkp1k = tkk + begin;
236 HepMatrix::mIter tkp2k = tkk + 2 * begin + 1;
237 for (int k=begin;k<=end-1;k++) {
238 double c,ds;
239 givens(x,z,&c,&ds);
240
241 // This is the result of G.T*t*G, making use of the special structure
242 // of t and G. Note that since t is symmetric, only the lower half
243 // needs to be updated. Equations were gotten from maple.
244
245 if (k!=begin)
246 {
247 *(tkk-1)= *(tkk-1)*c-(*(tkp1k-1))*ds;
248 *(tkp1k-1)=0;
249 }
250 double ap=(*tkk);
251 double bp=(*tkp1k);
252 double aq=(*tkp1k+1);
253 (*tkk)=ap*c*c-2*c*bp*ds+aq*ds*ds;
254 (*tkp1k)=c*ap*ds+bp*c*c-bp*ds*ds-ds*aq*c;
255 (*(tkp1k+1))=ap*ds*ds+2*c*bp*ds+aq*c*c;
256 if (k<end-1)
257 {
258 double bq=(*(tkp2k+1));
259 (*tkp2k)=-bq*ds;
260 (*(tkp2k+1))=bq*c;
261 x=(*tkp1k);
262 z=(*tkp2k);
263 tkk += k+1;
264 tkp1k += k+2;
265 }
266 if(k<end-2) tkp2k += k+3;
267 }
268}

◆ diagonalize()

HepMatrix CLHEP::diagonalize ( HepSymMatrix s)

Definition at line 318 of file MatrixLinear.cc.

319{
320 const double tolerance = 1e-12;
321 HepMatrix u= tridiagonal(hms);
322 int begin=1;
323 int end=hms->num_row();
324 while(begin!=end)
325 {
326 HepMatrix::mIter sii = hms->m.begin() + (begin+2)*(begin-1)/2;
327 HepMatrix::mIter sip1i = sii + begin;
328 for (int i=begin;i<=end-1;i++) {
329 if (fabs(*sip1i)<=
330 tolerance*(fabs(*sii)+fabs(*(sip1i+1)))) {
331 (*sip1i)=0;
332 }
333 if(i<end-1) {
334 sii += i+1;
335 sip1i += i+2;
336 }
337 }
338 while(begin<end && hms->fast(begin+1,begin) ==0) begin++;
339 while(end>begin && hms->fast(end,end-1) ==0) end--;
340 if (begin!=end)
341 diag_step(hms,&u,begin,end);
342 }
343 return u;
344}
void tridiagonal(HepSymMatrix *a, HepMatrix *hsm)
void diag_step(HepSymMatrix *t, int begin, int end)

Referenced by main(), norm(), and testRandMultiGauss().

◆ dot()

double CLHEP::dot ( const HepVector v1,
const HepVector v2 
)

Definition at line 542 of file Vector.cc.

543{
544 if(v1.num_row()!=v2.num_row())
545 HepGenMatrix::error("v1 and v2 need to be the same size in dot(HepVector, HepVector)");
546 double d= 0;
547 HepGenMatrix::mcIter a = v1.m.begin();
548 HepGenMatrix::mcIter b = v2.m.begin();
549 HepGenMatrix::mcIter e = a + v1.num_size();
550 for(;a<e;) d += (*(a++)) * (*(b++));
551 return d;
552}
virtual int num_size() const
Definition: Vector.cc:117

Referenced by min_line_dist().

◆ dsum() [1/4]

HepDiagMatrix CLHEP::dsum ( const HepDiagMatrix s1,
const HepDiagMatrix s2 
)

Definition at line 161 of file DiagMatrix.cc.

165{
166#else
167{
168 HepDiagMatrix mret(hm1.num_row() + hm2.num_row(),
169 0);
170#endif
171 mret.sub(1,hm1);
172 mret.sub(hm1.num_row()+1,hm2);
173 return mret;
174}

Referenced by matrix_test().

◆ dsum() [2/4]

HepMatrix CLHEP::dsum ( const HepMatrix hm1,
const HepMatrix hm2 
)

Definition at line 240 of file Matrix.cc.

244{
245#else
246{
247 HepMatrix mret(hm1.num_row() + hm2.num_row(), hm1.num_col() + hm2.num_col(),
248 0);
249#endif
250 mret.sub(1,1,hm1);
251 mret.sub(hm1.num_row()+1,hm1.num_col()+1,hm2);
252 return mret;
253}

◆ dsum() [3/4]

HepSymMatrix CLHEP::dsum ( const HepSymMatrix s1,
const HepSymMatrix s2 
)

Definition at line 192 of file SymMatrix.cc.

196{
197#else
198{
199 HepSymMatrix mret(hm1.num_row() + hm2.num_row(),
200 0);
201#endif
202 mret.sub(1,hm1);
203 mret.sub(hm1.num_row()+1,hm2);
204 return mret;
205}

◆ dsum() [4/4]

HepVector CLHEP::dsum ( const HepVector s1,
const HepVector s2 
)

Definition at line 193 of file Vector.cc.

197{
198#else
199{
200 HepVector mret(hm1.num_row() + hm2.num_row(),
201 0);
202#endif
203 mret.sub(1,hm1);
204 mret.sub(hm1.num_row()+1,hm2);
205 return mret;
206}

◆ engineIDulong()

template<class E >
unsigned long CLHEP::engineIDulong ( )

Definition at line 26 of file engineIDulong.h.

26 {
27 static const unsigned long id = crc32ul(E::engineName());
28 return id;
29}
unsigned long crc32ul(const std::string &s)

◆ gammln()

double CLHEP::gammln ( double  xx)

Definition at line 58 of file RandPoisson.cc.

58 {
59
60// Returns the value ln(Gamma(xx) for xx > 0. Full accuracy is obtained for
61// xx > 1. For 0 < xx < 1. the reflection formula (6.1.4) can be used first.
62// (Adapted from Numerical Recipes in C)
63
64 static const double cof[6] = {76.18009172947146,-86.50532032941677,
65 24.01409824083091, -1.231739572450155,
66 0.1208650973866179e-2, -0.5395239384953e-5};
67 int j;
68 double x = xx - 1.0;
69 double tmp = x + 5.5;
70 tmp -= (x + 0.5) * std::log(tmp);
71 double ser = 1.000000000190015;
72
73 for ( j = 0; j <= 5; j++ ) {
74 x += 1.0;
75 ser += cof[j]/x;
76 }
77 return -tmp + std::log(2.5066282746310005*ser);
78}

Referenced by CLHEP::RandPoisson::fire(), poisson::operator()(), and CLHEP::RandPoisson::shoot().

◆ givens()

void CLHEP::givens ( double  a,
double  b,
double c,
double s 
)

Definition at line 882 of file MatrixLinear.cc.

883{
884 if (b ==0) { *c=1; *ds=0; }
885 else {
886 if (fabs(b)>fabs(a)) {
887 double tau=-a/b;
888 *ds=1/sqrt(1+tau*tau);
889 *c=(*ds)*tau;
890 } else {
891 double tau=-b/a;
892 *c=1/sqrt(1+tau*tau);
893 *ds=(*c)*tau;
894 }
895 }
896}

◆ house() [1/2]

HepVector CLHEP::house ( const HepMatrix a,
int  row = 1,
int  col = 1 
)

Definition at line 371 of file MatrixLinear.cc.

372{
373 HepVector v(a.num_row()-row+1);
374/* not tested */
375 int n = a.num_col();
376 HepMatrix::mcIter aic = a.m.begin() + (row - 1) * n + (col - 1) ;
377 HepMatrix::mIter vp = v.m.begin();
378 for (int i=row;i<=a.num_row();i++) {
379 (*(vp++))=(*aic);
380 aic += n;
381 }
382 v(1)+=sign(a(row,col))*v.norm();
383 return v;
384}

◆ house() [2/2]

HepVector CLHEP::house ( const HepSymMatrix a,
int  row = 1,
int  col = 1 
)

Definition at line 353 of file MatrixLinear.cc.

354{
355 HepVector v(a.num_row()-row+1);
356/* not tested */
357 HepMatrix::mIter vp = v.m.begin();
358 HepMatrix::mcIter aci = a.m.begin() + col * (col - 1) / 2 + row - 1;
359 int i;
360 for (i=row;i<=col;i++) {
361 (*(vp++))=(*(aci++));
362 }
363 for (;i<=a.num_row();i++) {
364 (*(vp++))=(*aci);
365 aci += i;
366 }
367 v(1)+=sign(a(row,col))*v.norm();
368 return v;
369}

◆ house_with_update() [1/2]

void CLHEP::house_with_update ( HepMatrix a,
HepMatrix v,
int  row = 1,
int  col = 1 
)

Definition at line 424 of file MatrixLinear.cc.

425{
426 double normsq=0;
427 int nv = v->num_col();
428 int na = a->num_col();
429 HepMatrix::mIter vrc = v->m.begin() + (row-1) * nv + (col-1);
430 HepMatrix::mIter arc = a->m.begin() + (row-1) * na + (col-1);
431 int r;
432 for (r=row;r<=a->num_row();r++) {
433 (*vrc)=(*arc);
434 normsq+=(*vrc)*(*vrc);
435 if(r<a->num_row()) {
436 vrc += nv;
437 arc += na;
438 }
439 }
440 double norm=sqrt(normsq);
441 vrc = v->m.begin() + (row-1) * nv + (col-1);
442 normsq-=(*vrc)*(*vrc);
443 (*vrc)+=sign((*a)(row,col))*norm;
444 normsq+=(*vrc)*(*vrc);
445 (*a)(row,col)=-sign((*a)(row,col))*norm;
446 if (row<a->num_row()) {
447 arc = a->m.begin() + row * na + (col-1);
448 for (r=row+1;r<=a->num_row();r++) {
449 (*arc)=0;
450 if(r<a->num_row()) arc += na;
451 }
452 row_house(a,*v,normsq,row,col+1,row,col);
453 }
454}
double norm(const HepGenMatrix &m)
Definition: GenMatrix.cc:54
void row_house(HepMatrix *a, const HepVector &v, double vnormsq, int row=1, int col=1)

◆ house_with_update() [2/2]

void CLHEP::house_with_update ( HepMatrix a,
int  row = 1,
int  col = 1 
)

Definition at line 396 of file MatrixLinear.cc.

397{
398 HepVector v(a->num_row()-row+1);
399/* not tested */
400 HepMatrix::mIter vp = v.m.begin();
401 int n = a->num_col();
402 HepMatrix::mIter arc = a->m.begin() + (row-1) * n + (col-1);
403 int r;
404 for (r=row;r<=a->num_row();r++) {
405 (*(vp++))=(*arc);
406 if(r<a->num_row()) arc += n;
407 }
408 double normsq=v.normsq();
409 double norm=sqrt(normsq);
410 normsq-=v(1)*v(1);
411 v(1)+=sign((*a)(row,col))*norm;
412 normsq+=v(1)*v(1);
413 (*a)(row,col)=-sign((*a)(row,col))*norm;
414 if (row<a->num_row()) {
415 arc = a->m.begin() + row * n + (col-1);
416 for (r=row+1;r<=a->num_row();r++) {
417 (*arc)=0;
418 if(r<a->num_row()) arc += n;
419 }
420 row_house(a,v,normsq,row,col+1);
421 }
422}

Referenced by qr_decomp().

◆ house_with_update2()

void CLHEP::house_with_update2 ( HepSymMatrix a,
HepMatrix v,
int  row = 1,
int  col = 1 
)

Definition at line 462 of file MatrixLinear.cc.

463{
464 double normsq=0;
465 int nv = v->num_col();
466 HepMatrix::mIter vrc = v->m.begin() + (row-1) * nv + (col-1);
467 HepMatrix::mIter arc = a->m.begin() + (row-1) * row / 2 + (col-1);
468 int r;
469 for (r=row;r<=a->num_row();r++)
470 {
471 (*vrc)=(*arc);
472 normsq+=(*vrc)*(*vrc);
473 if(r<a->num_row()) {
474 arc += r;
475 vrc += nv;
476 }
477 }
478 double norm=sqrt(normsq);
479 vrc = v->m.begin() + (row-1) * nv + (col-1);
480 arc = a->m.begin() + (row-1) * row / 2 + (col-1);
481 (*vrc)+=sign(*arc)*norm;
482 (*arc)=-sign(*arc)*norm;
483 arc += row;
484 for (r=row+1;r<=a->num_row();r++) {
485 (*arc)=0;
486 if(r<a->num_row()) arc += r;
487 }
488}

◆ inverseOf() [1/9]

HepBoost CLHEP::inverseOf ( const HepBoost lt)
inline

◆ inverseOf() [2/9]

HepBoostX CLHEP::inverseOf ( const HepBoostX b)
inline

◆ inverseOf() [3/9]

HepBoostY CLHEP::inverseOf ( const HepBoostY b)
inline

◆ inverseOf() [4/9]

HepBoostZ CLHEP::inverseOf ( const HepBoostZ b)
inline

◆ inverseOf() [5/9]

HepLorentzRotation CLHEP::inverseOf ( const HepLorentzRotation lt)
inline

◆ inverseOf() [6/9]

HepRotation CLHEP::inverseOf ( const HepRotation r)
inline

◆ inverseOf() [7/9]

HepRotationX CLHEP::inverseOf ( const HepRotationX r)
inline

◆ inverseOf() [8/9]

HepRotationY CLHEP::inverseOf ( const HepRotationY r)
inline

◆ inverseOf() [9/9]

HepRotationZ CLHEP::inverseOf ( const HepRotationZ r)
inline

◆ min_line_dist()

HepVector CLHEP::min_line_dist ( const HepVector *const  A,
const HepVector *const  B,
int  n 
)

Definition at line 527 of file MatrixLinear.cc.

529{
530 // For (P-(A t +B))^2 minimum, we have tmin=dot(A,P-B)/A.normsq(). So
531 // To minimize distance, we want sum_i (P-(Ai tmini +Bi))^2 minimum. This
532 // is solved by having
533 // (sum_i k Ai*Ai.T +1) P - (sum_i k dot(Ai,Bi) Ai + Bi) = 0
534 // where k=1-2/Ai.normsq
535 const double small = 1e-10; // Small number
536 HepSymMatrix C(3,0),I(3,1);
537 HepVector D(3,0);
538 double t;
539 for (int i=0;i<n;i++)
540 {
541 if (fabs(t=A[i].normsq())<small) {
542 C += I;
543 D += B[i];
544 } else {
545 C += vT_times_v(A[i])*(1-2/t)+I;
546 D += dot(A[i],B[i])*(1-2/t)*A[i]+B[i];
547 }
548 }
549 return qr_solve(C,D);
550}
HepVector qr_solve(const HepMatrix &A, const HepVector &b)
Definition: excDblThrow.cc:8
Definition: excDblThrow.cc:17

◆ norm()

double CLHEP::norm ( const HepGenMatrix m)

Definition at line 54 of file GenMatrix.cc.

54 {
55 HepSymMatrix A(hm.num_col(),0);
56
57// Calculate hm.T*hm
58 int r;
59 for(r=1;r<=A.num_row();r++)
60 for(int c=1;c<=r;c++)
61 for(int i=1;i<=hm.num_row();i++)
62 A.fast(r,c)=hm(i,r)*hm(i,c);
63 diagonalize(&A);
64 double max=fabs(A(1,1));
65 for(r=2;r<=A.num_row();r++)
66 if(max<fabs(A(r,r))) max=fabs(A(r,r));
67 return (sqrt(max));
68}

Referenced by CLHEP::HepLorentzVector::howParallel(), CLHEP::HepLorentzVector::isParallel(), main(), CLHEP::HepBoost::print(), and CLHEP::HepLorentzRotation::set().

◆ norm1()

double CLHEP::norm1 ( const HepGenMatrix m)

Definition at line 43 of file GenMatrix.cc.

43 {
44 double max=0,sum;
45 for(int c=1;c<=hm.num_col();c++) {
46 sum=0;
47 for(int r=1;r<=hm.num_row();r++)
48 sum+=fabs(hm(r,c));
49 if(sum>max) max=sum;
50 }
51 return max;
52}

Referenced by main().

◆ norm_infinity()

double CLHEP::norm_infinity ( const HepGenMatrix m)

Definition at line 31 of file GenMatrix.cc.

31 {
32 double max=0,sum;
33 for(int r=1;r<=hm.num_row();r++) {
34 sum=0;
35 for(int c=1;c<=hm.num_col();c++) {
36 sum+=fabs(hm(r,c));
37 }
38 if(sum>max) max=sum;
39 }
40 return max;
41}

Referenced by main().

◆ operator!=() [1/2]

bool CLHEP::operator!= ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 364 of file LorentzRotation.h.

◆ operator!=() [2/2]

bool CLHEP::operator!= ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 351 of file LorentzRotation.h.

352 { return lt!=HepLorentzRotation(r); }

◆ operator*() [1/34]

double CLHEP::operator* ( const Hep2Vector a,
const Hep2Vector b 
)
inline

◆ operator*() [2/34]

Hep2Vector CLHEP::operator* ( const Hep2Vector p,
double  a 
)
inline

◆ operator*() [3/34]

double CLHEP::operator* ( const Hep3Vector ,
const Hep3Vector  
)
inline

◆ operator*() [4/34]

Hep3Vector CLHEP::operator* ( const Hep3Vector ,
double  a 
)
inline

◆ operator*() [5/34]

HepDiagMatrix CLHEP::operator* ( const HepDiagMatrix d1,
double  t 
)

Definition at line 348 of file DiagMatrix.cc.

351{
352#else
353{
354 HepDiagMatrix mret(hm1);
355#endif
356 mret *= t;
357 return mret;
358}

◆ operator*() [6/34]

HepDiagMatrix CLHEP::operator* ( const HepDiagMatrix hm1,
const HepDiagMatrix hm2 
)

Definition at line 413 of file DiagMatrix.cc.

416{
417#else
418{
419 HepDiagMatrix mret(hm1.num_row());
420#endif
421 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
422 HepMatrix::mIter a = mret.m.begin();
423 HepMatrix::mcIter b = hm1.m.begin();
424 HepMatrix::mcIter c = hm2.m.begin();
425 HepMatrix::mIter e = mret.m.begin() + hm1.num_col();
426 for(;a<e;) *(a++) = *(b++) * (*(c++));
427 return mret;
428}
#define CHK_DIM_1(c1, r2, fun)
Definition: DiagMatrix.cc:49

◆ operator*() [7/34]

HepMatrix CLHEP::operator* ( const HepDiagMatrix hm1,
const HepMatrix hm2 
)

Definition at line 392 of file DiagMatrix.cc.

395{
396#else
397{
398 HepMatrix mret(hm1.num_row(),hm2.num_col());
399#endif
400 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
401 HepMatrix::mcIter mit1=hm2.m.begin();
402 HepMatrix::mIter mir=mret.m.begin();
403 HepMatrix::mcIter mrr = hm1.m.begin();
404 for(int irow=1;irow<=hm2.num_row();irow++) {
405 for(int icol=1;icol<=hm2.num_col();icol++) {
406 *(mir++) = *(mit1++) * (*mrr);
407 }
408 mrr++;
409 }
410 return mret;
411}

◆ operator*() [8/34]

HepVector CLHEP::operator* ( const HepDiagMatrix hm1,
const HepVector hm2 
)

Definition at line 430 of file DiagMatrix.cc.

433{
434#else
435{
436 HepVector mret(hm1.num_row());
437#endif
438 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
439 HepGenMatrix::mIter mir=mret.m.begin();
440 HepGenMatrix::mcIter mi1 = hm1.m.begin(), mi2 = hm2.m.begin();
441 for(int icol=1;icol<=hm1.num_col();icol++) {
442 *(mir++) = *(mi1++) * *(mi2++);
443 }
444 return mret;
445}

◆ operator*() [9/34]

HepLorentzVector CLHEP::operator* ( const HepLorentzVector ,
double  a 
)
inline

◆ operator*() [10/34]

HepMatrix CLHEP::operator* ( const HepMatrix hm1,
const HepMatrix hm2 
)

Definition at line 349 of file Matrix.cc.

352{
353#else
354{
355 // initialize matrix to 0.0
356 HepMatrix mret(hm1.nrow,hm2.ncol,0);
357#endif
358 CHK_DIM_1(hm1.ncol,hm2.nrow,*);
359
360 int m1cols = hm1.ncol;
361 int m2cols = hm2.ncol;
362
363 for (int i=0; i<hm1.nrow; i++)
364 {
365 for (int j=0; j<m1cols; j++)
366 {
367 double temp = hm1.m[i*m1cols+j];
368 HepMatrix::mIter pt = mret.m.begin() + i*m2cols;
369
370 // Loop over k (the column index in matrix hm2)
371 HepMatrix::mcIter pb = hm2.m.begin() + m2cols*j;
372 const HepMatrix::mcIter pblast = pb + m2cols;
373 while (pb < pblast)
374 {
375 (*pt) += temp * (*pb);
376 pb++;
377 pt++;
378 }
379 }
380 }
381
382 return mret;
383}
#define CHK_DIM_1(c1, r2, fun)
Definition: Matrix.cc:54

◆ operator*() [11/34]

HepMatrix CLHEP::operator* ( const HepMatrix hm1,
double  t 
)

Definition at line 325 of file Matrix.cc.

328{
329#else
330{
331 HepMatrix mret(hm1);
332#endif
333 mret *= t;
334 return mret;
335}

◆ operator*() [12/34]

HepMatrix CLHEP::operator* ( const HepMatrix hm1,
const HepDiagMatrix hm2 
)

Definition at line 372 of file DiagMatrix.cc.

375{
376#else
377 {
378 HepMatrix mret(hm1.num_row(),hm2.num_col());
379#endif
380 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
381 HepMatrix::mcIter mit1=hm1.m.begin();
382 HepMatrix::mIter mir=mret.m.begin();
383 for(int irow=1;irow<=hm1.num_row();irow++) {
384 HepMatrix::mcIter mcc = hm2.m.begin();
385 for(int icol=1;icol<=hm1.num_col();icol++) {
386 *(mir++) = *(mit1++) * (*(mcc++));
387 }
388 }
389 return mret;
390 }

◆ operator*() [13/34]

HepMatrix CLHEP::operator* ( const HepMatrix hm1,
const HepSymMatrix hm2 
)

Definition at line 353 of file SymMatrix.cc.

356{
357#else
358 {
359 HepMatrix mret(hm1.num_row(),hm2.num_col());
360#endif
361 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
362 HepMatrix::mcIter mit1, mit2, sp,snp; //mit2=0
363 double temp;
364 HepMatrix::mIter mir=mret.m.begin();
365 for(mit1=hm1.m.begin();
366 mit1<hm1.m.begin()+hm1.num_row()*hm1.num_col();
367 mit1 = mit2)
368 {
369 snp=hm2.m.begin();
370 for(int step=1;step<=hm2.num_row();++step)
371 {
372 mit2=mit1;
373 sp=snp;
374 snp+=step;
375 temp=0;
376 while(sp<snp)
377 temp+=*(sp++)*(*(mit2++));
378 if( step<hm2.num_row() ) { // only if we aren't on the last row
379 sp+=step-1;
380 for(int stept=step+1;stept<=hm2.num_row();stept++)
381 {
382 temp+=*sp*(*(mit2++));
383 if(stept<hm2.num_row()) sp+=stept;
384 }
385 } // if(step
386 *(mir++)=temp;
387 } // for(step
388 } // for(mit1
389 return mret;
390 }
#define CHK_DIM_1(c1, r2, fun)
Definition: SymMatrix.cc:49
int num_col() const

◆ operator*() [14/34]

HepVector CLHEP::operator* ( const HepMatrix hm1,
const HepVector hm2 
)

Definition at line 354 of file Vector.cc.

357{
358#else
359{
360 HepVector mret(hm1.num_row());
361#endif
362 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
363 HepGenMatrix::mcIter hm1p,hm2p,vp;
365 double temp;
366 m3p=mret.m.begin();
367 for(hm1p=hm1.m.begin();hm1p<hm1.m.begin()+hm1.num_row()*hm1.num_col();hm1p=hm2p)
368 {
369 temp=0;
370 vp=hm2.m.begin();
371 hm2p=hm1p;
372 while(hm2p<hm1p+hm1.num_col())
373 temp+=(*(hm2p++))*(*(vp++));
374 *(m3p++)=temp;
375 }
376 return mret;
377}
#define CHK_DIM_1(c1, r2, fun)
Definition: Vector.cc:46

◆ operator*() [15/34]

HepLorentzRotation CLHEP::operator* ( const HepRotation r,
const HepLorentzRotation lt 
)

Definition at line 259 of file LorentzRotation.cc.

260 {
261 r.rep4x4();
262 lt.rep4x4();
264 r.xx()*lt.xx() + r.xy()*lt.yx() + r.xz()*lt.zx() + r.xt()*lt.tx(),
265 r.xx()*lt.xy() + r.xy()*lt.yy() + r.xz()*lt.zy() + r.xt()*lt.ty(),
266 r.xx()*lt.xz() + r.xy()*lt.yz() + r.xz()*lt.zz() + r.xt()*lt.tz(),
267 r.xx()*lt.xt() + r.xy()*lt.yt() + r.xz()*lt.zt() + r.xt()*lt.tt(),
268
269 r.yx()*lt.xx() + r.yy()*lt.yx() + r.yz()*lt.zx() + r.yt()*lt.tx(),
270 r.yx()*lt.xy() + r.yy()*lt.yy() + r.yz()*lt.zy() + r.yt()*lt.ty(),
271 r.yx()*lt.xz() + r.yy()*lt.yz() + r.yz()*lt.zz() + r.yt()*lt.tz(),
272 r.yx()*lt.xt() + r.yy()*lt.yt() + r.yz()*lt.zt() + r.yt()*lt.tt(),
273
274 r.zx()*lt.xx() + r.zy()*lt.yx() + r.zz()*lt.zx() + r.zt()*lt.tx(),
275 r.zx()*lt.xy() + r.zy()*lt.yy() + r.zz()*lt.zy() + r.zt()*lt.ty(),
276 r.zx()*lt.xz() + r.zy()*lt.yz() + r.zz()*lt.zz() + r.zt()*lt.tz(),
277 r.zx()*lt.xt() + r.zy()*lt.yt() + r.zz()*lt.zt() + r.zt()*lt.tt(),
278
279 r.tx()*lt.xx() + r.ty()*lt.yx() + r.tz()*lt.zx() + r.tt()*lt.tx(),
280 r.tx()*lt.xy() + r.ty()*lt.yy() + r.tz()*lt.zy() + r.tt()*lt.ty(),
281 r.tx()*lt.xz() + r.ty()*lt.yz() + r.tz()*lt.zz() + r.tt()*lt.tz(),
282 r.tx()*lt.xt() + r.ty()*lt.yt() + r.tz()*lt.zt() + r.tt()*lt.tt() ) );
283}
HepRep4x4 rep4x4() const
double zz() const
double yz() const
double zx() const
double tz() const
double ty() const
double tx() const
double yx() const
double zy() const
HepRep4x4 rep4x4() const
double zt() const
double xx() const
double tt() const
double yy() const
double xz() const
double yt() const
double xy() const
double xt() const

◆ operator*() [16/34]

HepLorentzRotation CLHEP::operator* ( const HepRotationX r,
const HepLorentzRotation lt 
)

◆ operator*() [17/34]

HepRotation CLHEP::operator* ( const HepRotationX rx,
const HepRotation r 
)
inline

◆ operator*() [18/34]

HepLorentzRotation CLHEP::operator* ( const HepRotationY r,
const HepLorentzRotation lt 
)

◆ operator*() [19/34]

HepRotation CLHEP::operator* ( const HepRotationY ry,
const HepRotation r 
)
inline

◆ operator*() [20/34]

HepLorentzRotation CLHEP::operator* ( const HepRotationZ r,
const HepLorentzRotation lt 
)

◆ operator*() [21/34]

HepRotation CLHEP::operator* ( const HepRotationZ rz,
const HepRotation r 
)
inline

◆ operator*() [22/34]

HepMatrix CLHEP::operator* ( const HepSymMatrix hm1,
const HepMatrix hm2 
)

Definition at line 392 of file SymMatrix.cc.

395{
396#else
397{
398 HepMatrix mret(hm1.num_row(),hm2.num_col());
399#endif
400 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
401 int step,stept;
402 HepMatrix::mcIter mit1,mit2,sp,snp;
403 double temp;
404 HepMatrix::mIter mir=mret.m.begin();
405 for(step=1,snp=hm1.m.begin();step<=hm1.num_row();snp+=step++)
406 for(mit1=hm2.m.begin();mit1<hm2.m.begin()+hm2.num_col();mit1++)
407 {
408 mit2=mit1;
409 sp=snp;
410 temp=0;
411 while(sp<snp+step)
412 {
413 temp+=*mit2*(*(sp++));
414 if( hm2.num_size()-(mit2-hm2.m.begin())>hm2.num_col() ){
415 mit2+=hm2.num_col();
416 }
417 }
418 if(step<hm1.num_row()) { // only if we aren't on the last row
419 sp+=step-1;
420 for(stept=step+1;stept<=hm1.num_row();stept++)
421 {
422 temp+=*mit2*(*sp);
423 if(stept<hm1.num_row()) {
424 mit2+=hm2.num_col();
425 sp+=stept;
426 }
427 }
428 } // if(step
429 *(mir++)=temp;
430 } // for(mit1
431 return mret;
432}
virtual int num_size() const
Definition: Matrix.cc:122

◆ operator*() [23/34]

HepMatrix CLHEP::operator* ( const HepSymMatrix hm1,
const HepSymMatrix hm2 
)

Definition at line 434 of file SymMatrix.cc.

437{
438#else
439{
440 HepMatrix mret(hm1.num_row(),hm1.num_row());
441#endif
442 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
443 int step1,stept1,step2,stept2;
444 HepMatrix::mcIter snp1,sp1,snp2,sp2;
445 double temp;
446 HepMatrix::mIter mr = mret.m.begin();
447 snp1=hm1.m.begin();
448 for(step1=1;step1<=hm1.num_row();++step1) {
449 snp2=hm2.m.begin();
450 for(step2=1;step2<=hm2.num_row();++step2)
451 {
452 sp1=snp1;
453 sp2=snp2;
454 snp2+=step2;
455 temp=0;
456 if(step1<step2)
457 {
458 while(sp1<snp1+step1) {
459 temp+=(*(sp1++))*(*(sp2++));
460 }
461 sp1+=step1-1;
462 for(stept1=step1+1;stept1!=step2+1;++stept1) {
463 temp+=(*sp1)*(*(sp2++));
464 if(stept1<hm2.num_row()) sp1+=stept1;
465 }
466 if(step2<hm2.num_row()) { // only if we aren't on the last row
467 sp2+=step2-1;
468 for(stept2=step2+1;stept2<=hm2.num_row();stept1++,stept2++) {
469 temp+=(*sp1)*(*sp2);
470 if(stept2<hm2.num_row()) {
471 sp1+=stept1;
472 sp2+=stept2;
473 }
474 } // for(stept2
475 } // if(step2
476 } // step1<step2
477 else
478 {
479 while(sp2<snp2) {
480 temp+=(*(sp1++))*(*(sp2++));
481 }
482 if(step2<hm2.num_row()) { // only if we aren't on the last row
483 sp2+=step2-1;
484 for(stept2=step2+1;stept2!=step1+1;stept2++) {
485 temp+=(*(sp1++))*(*sp2);
486 if(stept2<hm1.num_row()) sp2+=stept2;
487 }
488 if(step1<hm1.num_row()) { // only if we aren't on the last row
489 sp1+=step1-1;
490 for(stept1=step1+1;stept1<=hm1.num_row();stept1++,stept2++) {
491 temp+=(*sp1)*(*sp2);
492 if(stept1<hm1.num_row()) {
493 sp1+=stept1;
494 sp2+=stept2;
495 }
496 } // for(stept1
497 } // if(step1
498 } // if(step2
499 } // else
500 *(mr++)=temp;
501 } // for(step2
502 if(step1<hm1.num_row()) snp1+=step1;
503 } // for(step1
504 return mret;
505}

◆ operator*() [24/34]

HepVector CLHEP::operator* ( const HepSymMatrix hm1,
const HepVector hm2 
)

Definition at line 507 of file SymMatrix.cc.

510{
511#else
512{
513 HepVector mret(hm1.num_row());
514#endif
515 CHK_DIM_1(hm1.num_col(),hm2.num_row(),*);
516 HepMatrix::mcIter sp,snp,vpt;
517 double temp;
518 int step,stept;
519 HepMatrix::mIter vrp=mret.m.begin();
520 for(step=1,snp=hm1.m.begin();step<=hm1.num_row();++step)
521 {
522 sp=snp;
523 vpt=hm2.m.begin();
524 snp+=step;
525 temp=0;
526 while(sp<snp)
527 temp+=*(sp++)*(*(vpt++));
528 if(step<hm1.num_row()) sp+=step-1;
529 for(stept=step+1;stept<=hm1.num_row();stept++)
530 {
531 temp+=*sp*(*(vpt++));
532 if(stept<hm1.num_row()) sp+=stept;
533 }
534 *(vrp++)=temp;
535 } // for(step
536 return mret;
537}

◆ operator*() [25/34]

HepSymMatrix CLHEP::operator* ( const HepSymMatrix s1,
double  t 
)

Definition at line 328 of file SymMatrix.cc.

331{
332#else
333{
334 HepSymMatrix mret(hm1);
335#endif
336 mret *= t;
337 return mret;
338}

◆ operator*() [26/34]

HepMatrix CLHEP::operator* ( const HepVector hm1,
const HepMatrix hm2 
)

Definition at line 379 of file Vector.cc.

382{
383#else
384{
385 HepMatrix mret(hm1.num_row(),hm2.num_col());
386#endif
387 CHK_DIM_1(1,hm2.num_row(),*);
390 HepMatrix::mIter mrp=mret.m.begin();
391 for(hm1p=hm1.m.begin();hm1p<hm1.m.begin()+hm1.num_row();hm1p++)
392 for(hm2p=hm2.m.begin();hm2p<hm2.m.begin()+hm2.num_col();hm2p++)
393 *(mrp++)=*hm1p*(*hm2p);
394 return mret;
395}

◆ operator*() [27/34]

HepVector CLHEP::operator* ( const HepVector v1,
double  t 
)

Definition at line 330 of file Vector.cc.

333{
334#else
335{
336 HepVector mret(hm1);
337#endif
338 mret *= t;
339 return mret;
340}

◆ operator*() [28/34]

Hep2Vector CLHEP::operator* ( double  a,
const Hep2Vector p 
)
inline

◆ operator*() [29/34]

Hep3Vector CLHEP::operator* ( double  a,
const Hep3Vector  
)
inline

◆ operator*() [30/34]

HepLorentzVector CLHEP::operator* ( double  a,
const HepLorentzVector  
)
inline

◆ operator*() [31/34]

HepDiagMatrix CLHEP::operator* ( double  t,
const HepDiagMatrix d1 
)

Definition at line 360 of file DiagMatrix.cc.

363{
364#else
365{
366 HepDiagMatrix mret(hm1);
367#endif
368 mret *= t;
369 return mret;
370}

◆ operator*() [32/34]

HepMatrix CLHEP::operator* ( double  t,
const HepMatrix hm1 
)

Definition at line 337 of file Matrix.cc.

340{
341#else
342{
343 HepMatrix mret(hm1);
344#endif
345 mret *= t;
346 return mret;
347}

◆ operator*() [33/34]

HepSymMatrix CLHEP::operator* ( double  t,
const HepSymMatrix s1 
)

Definition at line 340 of file SymMatrix.cc.

343{
344#else
345{
346 HepSymMatrix mret(hm1);
347#endif
348 mret *= t;
349 return mret;
350}

◆ operator*() [34/34]

HepVector CLHEP::operator* ( double  t,
const HepVector v1 
)

Definition at line 342 of file Vector.cc.

345{
346#else
347{
348 HepVector mret(hm1);
349#endif
350 mret *= t;
351 return mret;
352}

◆ operator+() [1/14]

Hep2Vector CLHEP::operator+ ( const Hep2Vector a,
const Hep2Vector b 
)
inline

◆ operator+() [2/14]

Hep3Vector CLHEP::operator+ ( const Hep3Vector ,
const Hep3Vector  
)
inline

◆ operator+() [3/14]

HepMatrix CLHEP::operator+ ( const HepDiagMatrix d1,
const HepMatrix hm2 
)

Definition at line 207 of file DiagMatrix.cc.

210{
211#else
212{
213 HepMatrix mret(hm2);
214#endif
215 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
216 hm1.num_col(),hm2.num_col(),+);
217 mret += hm1;
218 return mret;
219}
#define CHK_DIM_2(r1, r2, c1, c2, fun)
Definition: DiagMatrix.cc:44

◆ operator+() [4/14]

HepSymMatrix CLHEP::operator+ ( const HepDiagMatrix d1,
const HepSymMatrix s2 
)

Definition at line 234 of file DiagMatrix.cc.

237{
238#else
239{
240 HepSymMatrix mret(hm2);
241#endif
242 CHK_DIM_1(hm1.num_row(),hm2.num_row(),+);
243 mret += hm1;
244 return mret;
245}

◆ operator+() [5/14]

HepDiagMatrix CLHEP::operator+ ( const HepDiagMatrix hm1,
const HepDiagMatrix d2 
)

Definition at line 221 of file DiagMatrix.cc.

224{
225#else
226{
227 HepDiagMatrix mret(hm1.nrow);
228#endif
229 CHK_DIM_1(hm1.nrow,hm2.nrow,+);
230 SIMPLE_TOP(+)
231 return mret;
232}
#define SIMPLE_TOP(OPER)
Definition: DiagMatrix.cc:37

◆ operator+() [6/14]

HepMatrix CLHEP::operator+ ( const HepMatrix hm1,
const HepDiagMatrix d2 
)

Definition at line 193 of file DiagMatrix.cc.

196{
197#else
198{
199 HepMatrix mret(hm1);
200#endif
201 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
202 hm1.num_col(),hm2.num_col(),+);
203 mret += hm2;
204 return mret;
205}

◆ operator+() [7/14]

HepMatrix CLHEP::operator+ ( const HepMatrix hm1,
const HepMatrix hm2 
)

Definition at line 276 of file Matrix.cc.

279{
280#else
281{
282 HepMatrix mret(hm1.nrow, hm1.ncol);
283#endif
284 CHK_DIM_2(hm1.num_row(),hm2.num_row(), hm1.num_col(),hm2.num_col(),+);
285 SIMPLE_TOP(+)
286 return mret;
287}
#define CHK_DIM_2(r1, r2, c1, c2, fun)
Definition: Matrix.cc:49
#define SIMPLE_TOP(OPER)
Definition: Matrix.cc:40

◆ operator+() [8/14]

HepMatrix CLHEP::operator+ ( const HepMatrix hm1,
const HepSymMatrix s2 
)

Definition at line 228 of file SymMatrix.cc.

231{
232#else
233{
234 HepMatrix mret(hm1);
235#endif
236 CHK_DIM_2(hm1.num_row(),hm2.num_row(), hm1.num_col(),hm2.num_col(),+);
237 mret += hm2;
238 return mret;
239}
#define CHK_DIM_2(r1, r2, c1, c2, fun)
Definition: SymMatrix.cc:44

◆ operator+() [9/14]

HepVector CLHEP::operator+ ( const HepMatrix hm1,
const HepVector v2 
)

Definition at line 229 of file Vector.cc.

232{
233#else
234{
235 HepVector mret(hm2);
236#endif
237 CHK_DIM_2(hm1.num_row(),hm2.num_row(),hm1.num_col(),1,+);
238 mret += hm1;
239 return mret;
240}
#define CHK_DIM_2(r1, r2, c1, c2, fun)
Definition: Vector.cc:41

◆ operator+() [10/14]

HepSymMatrix CLHEP::operator+ ( const HepSymMatrix s1,
const HepDiagMatrix d2 
)

Definition at line 247 of file DiagMatrix.cc.

250{
251#else
252{
253 HepSymMatrix mret(hm2);
254#endif
255 CHK_DIM_1(hm1.num_row(),hm2.num_row(),+);
256 mret += hm1;
257 return mret;
258}

◆ operator+() [11/14]

HepMatrix CLHEP::operator+ ( const HepSymMatrix s1,
const HepMatrix hm2 
)

Definition at line 240 of file SymMatrix.cc.

243{
244#else
245{
246 HepMatrix mret(hm2);
247#endif
248 CHK_DIM_2(hm1.num_row(),hm2.num_row(),hm1.num_col(),hm2.num_col(),+);
249 mret += hm1;
250 return mret;
251}

◆ operator+() [12/14]

HepSymMatrix CLHEP::operator+ ( const HepSymMatrix s1,
const HepSymMatrix s2 
)

Definition at line 253 of file SymMatrix.cc.

256{
257#else
258{
259 HepSymMatrix mret(hm1.nrow);
260#endif
261 CHK_DIM_1(hm1.nrow, hm2.nrow,+);
262 SIMPLE_TOP(+)
263 return mret;
264}
#define SIMPLE_TOP(OPER)
Definition: SymMatrix.cc:37

◆ operator+() [13/14]

HepVector CLHEP::operator+ ( const HepVector v1,
const HepMatrix hm2 
)

Definition at line 242 of file Vector.cc.

245{
246#else
247{
248 HepVector mret(hm1);
249#endif
250 CHK_DIM_2(hm1.num_row(),hm2.num_row(),1,hm2.num_col(),+);
251 mret += hm2;
252 return mret;
253}

◆ operator+() [14/14]

HepVector CLHEP::operator+ ( const HepVector v1,
const HepVector v2 
)

Definition at line 255 of file Vector.cc.

258{
259#else
260{
261 HepVector mret(hm1.num_row());
262#endif
263 CHK_DIM_1(hm1.num_row(),hm2.num_row(),+);
264 SIMPLE_TOP(+)
265 return mret;
266}
#define SIMPLE_TOP(OPER)
Definition: Vector.cc:34

◆ operator-() [1/14]

Hep2Vector CLHEP::operator- ( const Hep2Vector a,
const Hep2Vector b 
)
inline

◆ operator-() [2/14]

Hep3Vector CLHEP::operator- ( const Hep3Vector ,
const Hep3Vector  
)
inline

◆ operator-() [3/14]

HepDiagMatrix CLHEP::operator- ( const HepDiagMatrix d1,
const HepDiagMatrix d2 
)

Definition at line 291 of file DiagMatrix.cc.

294{
295#else
296{
297 HepDiagMatrix mret(hm1.nrow);
298#endif
299 CHK_DIM_1(hm1.num_row(),hm2.num_row(),-);
300 SIMPLE_TOP(-)
301 return mret;
302}

◆ operator-() [4/14]

HepMatrix CLHEP::operator- ( const HepDiagMatrix d1,
const HepMatrix hm2 
)

Definition at line 277 of file DiagMatrix.cc.

280{
281#else
282{
283 HepMatrix mret(hm1);
284#endif
285 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
286 hm1.num_col(),hm2.num_col(),-);
287 mret -= hm2;
288 return mret;
289}

◆ operator-() [5/14]

HepSymMatrix CLHEP::operator- ( const HepDiagMatrix d1,
const HepSymMatrix s2 
)

Definition at line 303 of file DiagMatrix.cc.

306{
307#else
308{
309 HepSymMatrix mret(hm1);
310#endif
311 CHK_DIM_1(hm1.num_row(),hm2.num_row(),-);
312 mret -= hm2;
313 return mret;
314}

◆ operator-() [6/14]

HepMatrix CLHEP::operator- ( const HepMatrix hm1,
const HepDiagMatrix d2 
)

Definition at line 264 of file DiagMatrix.cc.

267{
268#else
269{
270 HepMatrix mret(hm1);
271#endif
272 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
273 hm1.num_col(),hm2.num_col(),-);
274 mret -= hm2;
275 return mret;
276}

◆ operator-() [7/14]

HepMatrix CLHEP::operator- ( const HepMatrix hm1,
const HepMatrix hm2 
)

Definition at line 293 of file Matrix.cc.

296{
297#else
298{
299 HepMatrix mret(hm1.num_row(), hm1.num_col());
300#endif
301 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
302 hm1.num_col(),hm2.num_col(),-);
303 SIMPLE_TOP(-)
304 return mret;
305}

◆ operator-() [8/14]

HepMatrix CLHEP::operator- ( const HepMatrix hm1,
const HepSymMatrix s2 
)

Definition at line 270 of file SymMatrix.cc.

273{
274#else
275{
276 HepMatrix mret(hm1);
277#endif
278 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
279 hm1.num_col(),hm2.num_col(),-);
280 mret -= hm2;
281 return mret;
282}

◆ operator-() [9/14]

HepVector CLHEP::operator- ( const HepMatrix hm1,
const HepVector v2 
)

Definition at line 272 of file Vector.cc.

275{
276#else
277{
278 HepVector mret;
279#endif
280 CHK_DIM_2(hm1.num_row(),hm2.num_row(),hm1.num_col(),1,-);
281 mret = hm1;
282 mret -= hm2;
283 return mret;
284}

◆ operator-() [10/14]

HepMatrix CLHEP::operator- ( const HepSymMatrix hm1,
const HepMatrix hm2 
)

Definition at line 283 of file SymMatrix.cc.

286{
287#else
288{
289 HepMatrix mret(hm1);
290#endif
291 CHK_DIM_2(hm1.num_row(),hm2.num_row(),
292 hm1.num_col(),hm2.num_col(),-);
293 mret -= hm2;
294 return mret;
295}

◆ operator-() [11/14]

HepSymMatrix CLHEP::operator- ( const HepSymMatrix s1,
const HepDiagMatrix d2 
)

Definition at line 316 of file DiagMatrix.cc.

319{
320#else
321{
322 HepSymMatrix mret(hm1);
323#endif
324 CHK_DIM_1(hm1.num_row(),hm2.num_row(),-);
325 mret -= hm2;
326 return mret;
327}

◆ operator-() [12/14]

HepSymMatrix CLHEP::operator- ( const HepSymMatrix s1,
const HepSymMatrix s2 
)

Definition at line 297 of file SymMatrix.cc.

300{
301#else
302{
303 HepSymMatrix mret(hm1.num_row());
304#endif
305 CHK_DIM_1(hm1.num_row(),hm2.num_row(),-);
306 SIMPLE_TOP(-)
307 return mret;
308}

◆ operator-() [13/14]

HepVector CLHEP::operator- ( const HepVector v1,
const HepMatrix hm2 
)

Definition at line 286 of file Vector.cc.

289{
290#else
291{
292 HepVector mret(hm1);
293#endif
294 CHK_DIM_2(hm1.num_row(),hm2.num_row(),1,hm2.num_col(),-);
295 mret -= hm2;
296 return mret;
297}

◆ operator-() [14/14]

HepVector CLHEP::operator- ( const HepVector v1,
const HepVector v2 
)

Definition at line 299 of file Vector.cc.

302{
303#else
304{
305 HepVector mret(hm1.num_row());
306#endif
307 CHK_DIM_1(hm1.num_row(),hm2.num_row(),-);
308 SIMPLE_TOP(-)
309 return mret;
310}

◆ operator/() [1/7]

Hep2Vector CLHEP::operator/ ( const Hep2Vector p,
double  a 
)

Definition at line 63 of file TwoVector.cc.

63 {
64 if (a==0) {
65 ZMthrowA(ZMxpvInfiniteVector( "Division of Hep2Vector by zero"));
66 }
67 return Hep2Vector(p.x()/a, p.y()/a);
68}
#define ZMthrowA(A)
Definition: ZMxpv.h:128
double x() const
double y() const

◆ operator/() [2/7]

Hep3Vector CLHEP::operator/ ( const Hep3Vector v1,
double  c 
)

Definition at line 295 of file ThreeVector.cc.

295 {
296 if (c == 0) {
297 ZMthrowA ( ZMxpvInfiniteVector (
298 "Attempt to divide vector by 0 -- "
299 "will produce infinities and/or NANs"));
300 }
301 return v1 * (1.0/c);
302} /* v / c */

◆ operator/() [3/7]

HepDiagMatrix CLHEP::operator/ ( const HepDiagMatrix hm1,
double  t 
)

Definition at line 335 of file DiagMatrix.cc.

339{
340#else
341{
342 HepDiagMatrix mret(hm1);
343#endif
344 mret /= t;
345 return mret;
346}

◆ operator/() [4/7]

HepLorentzVector CLHEP::operator/ ( const HepLorentzVector w,
double  c 
)

Definition at line 159 of file LorentzVector.cc.

159 {
160if (c == 0) {
161 ZMthrowA (ZMxpvInfiniteVector(
162 "Attempt to do LorentzVector / 0 -- \n"
163 "division by zero would produce infinite or NAN components"));
164 }
165 double oneOverC = 1.0/c;
166 return HepLorentzVector (w.getV() * oneOverC,
167 w.getT() * oneOverC);
168} /* LV = w / c */
Hep3Vector getV() const

◆ operator/() [5/7]

HepMatrix CLHEP::operator/ ( const HepMatrix hm1,
double  t 
)

Definition at line 312 of file Matrix.cc.

316{
317#else
318{
319 HepMatrix mret(hm1);
320#endif
321 mret /= t;
322 return mret;
323}

◆ operator/() [6/7]

HepSymMatrix CLHEP::operator/ ( const HepSymMatrix hm1,
double  t 
)

Definition at line 315 of file SymMatrix.cc.

319{
320#else
321{
322 HepSymMatrix mret(hm1);
323#endif
324 mret /= t;
325 return mret;
326}

◆ operator/() [7/7]

HepVector CLHEP::operator/ ( const HepVector v1,
double  t 
)

Definition at line 317 of file Vector.cc.

321{
322#else
323{
324 HepVector mret(hm1);
325#endif
326 mret /= t;
327 return mret;
328}

◆ operator<() [1/2]

bool CLHEP::operator< ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 370 of file LorentzRotation.h.

371 { return lt<b; }

◆ operator<() [2/2]

bool CLHEP::operator< ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 357 of file LorentzRotation.h.

358 { return lt<r; }

◆ operator<<() [1/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const Hep2Vector q 
)

Definition at line 70 of file TwoVector.cc.

70 {
71 os << "(" << q.x() << ", " << q.y() << ")";
72 return os;
73}

◆ operator<<() [2/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const Hep3Vector v 
)

Definition at line 66 of file ThreeVector.cc.

66 {
67 return os << "(" << v.x() << "," << v.y() << "," << v.z() << ")";
68}
double z() const
double x() const
double y() const

◆ operator<<() [3/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepAxisAngle aa 
)

Definition at line 90 of file AxisAngle.cc.

90 {
91 os << '(' << aa.axis() << ", " << aa.delta() << ')';
92 return os;
93} // operator<<()
double delta() const
Hep3Vector axis() const

◆ operator<<() [4/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepBoost b 
)
inline

Definition at line 239 of file Boost.h.

240{return b.print(os);}
std::ostream & print(std::ostream &os) const
Definition: Boost.cc:248

◆ operator<<() [5/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepBoostX b 
)
inline

Definition at line 213 of file BoostX.h.

214{return b.print(os);}
std::ostream & print(std::ostream &os) const
Definition: BoostX.cc:158

◆ operator<<() [6/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepBoostY b 
)
inline

Definition at line 214 of file BoostY.h.

215{return b.print(os);}
std::ostream & print(std::ostream &os) const
Definition: BoostY.cc:157

◆ operator<<() [7/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepBoostZ b 
)
inline

Definition at line 213 of file BoostZ.h.

214{return b.print(os);}
std::ostream & print(std::ostream &os) const
Definition: BoostZ.cc:157

◆ operator<<() [8/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepEulerAngles ea 
)

Definition at line 102 of file EulerAngles.cc.

103{
104 os << "(" << ea.phi() << ", " << ea.theta() << ", " << ea.psi() << ")";
105 return os;
106} // operator<<()
double phi() const
double theta() const
double psi() const

◆ operator<<() [9/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepLorentzRotation lt 
)
inline

Definition at line 345 of file LorentzRotation.h.

347 {return lt.print(os);}
std::ostream & print(std::ostream &os) const

◆ operator<<() [10/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepLorentzVector v1 
)

Definition at line 85 of file LorentzVector.cc.

86{
87 return os << "(" << v1.x() << "," << v1.y() << "," << v1.z()
88 << ";" << v1.t() << ")";
89}

◆ operator<<() [11/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRandom dist 
)

Definition at line 221 of file Random.cc.

221 {
222 return dist.put(os);
223}
virtual std::ostream & put(std::ostream &os) const
Definition: Random.cc:229

◆ operator<<() [12/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRandomEngine e 
)

Definition at line 102 of file RandomEngine.cc.

102 {
103 return e.put(os);
104}
virtual std::ostream & put(std::ostream &os) const
Definition: RandomEngine.cc:61

◆ operator<<() [13/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRotation r 
)
inline

Definition at line 408 of file Rotation.h.

409{return r.print(os);}
std::ostream & print(std::ostream &os) const
Definition: RotationIO.cc:18

◆ operator<<() [14/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRotationX r 
)
inline

Definition at line 276 of file RotationX.h.

277{return r.print(os);}
std::ostream & print(std::ostream &os) const
Definition: RotationX.cc:186

◆ operator<<() [15/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRotationY r 
)
inline

Definition at line 276 of file RotationY.h.

277{return r.print(os);}
std::ostream & print(std::ostream &os) const
Definition: RotationY.cc:189

◆ operator<<() [16/20]

std::ostream & CLHEP::operator<< ( std::ostream &  os,
const HepRotationZ r 
)
inline

Definition at line 276 of file RotationZ.h.

277{return r.print(os);}
std::ostream & print(std::ostream &os) const
Definition: RotationZ.cc:177

◆ operator<<() [17/20]

std::ostream & CLHEP::operator<< ( std::ostream &  s,
const HepDiagMatrix q 
)

Definition at line 560 of file DiagMatrix.cc.

561{
562 os << "\n";
563/* Fixed format needs 3 extra characters for field, while scientific needs 7 */
564 long width;
565 if(os.flags() & std::ios::fixed)
566 width = os.precision()+3;
567 else
568 width = os.precision()+7;
569 for(int irow = 1; irow<= q.num_row(); irow++)
570 {
571 for(int icol = 1; icol <= q.num_col(); icol++)
572 {
573 os.width(width);
574 os << q(irow,icol) << " ";
575 }
576 os << std::endl;
577 }
578 return os;
579}

◆ operator<<() [18/20]

std::ostream & CLHEP::operator<< ( std::ostream &  s,
const HepMatrix q 
)

Definition at line 433 of file Matrix.cc.

434{
435 os << "\n";
436/* Fixed format needs 3 extra characters for field, while scientific needs 7 */
437 long width;
438 if(os.flags() & std::ios::fixed)
439 width = os.precision()+3;
440 else
441 width = os.precision()+7;
442 for(int irow = 1; irow<= q.num_row(); irow++)
443 {
444 for(int icol = 1; icol <= q.num_col(); icol++)
445 {
446 os.width(width);
447 os << q(irow,icol) << " ";
448 }
449 os << std::endl;
450 }
451 return os;
452}

◆ operator<<() [19/20]

std::ostream & CLHEP::operator<< ( std::ostream &  s,
const HepSymMatrix q 
)

Definition at line 675 of file SymMatrix.cc.

676{
677 os << std::endl;
678/* Fixed format needs 3 extra characters for field, while scientific needs 7 */
679 long width;
680 if(os.flags() & std::ios::fixed)
681 width = os.precision()+3;
682 else
683 width = os.precision()+7;
684 for(int irow = 1; irow<= q.num_row(); irow++)
685 {
686 for(int icol = 1; icol <= q.num_col(); icol++)
687 {
688 os.width(width);
689 os << q(irow,icol) << " ";
690 }
691 os << std::endl;
692 }
693 return os;
694}

◆ operator<<() [20/20]

std::ostream & CLHEP::operator<< ( std::ostream &  s,
const HepVector v 
)

Definition at line 513 of file Vector.cc.

514{
515 os << std::endl;
516/* Fixed format needs 3 extra characters for field, while scientific needs 7 */
517 long width;
518 if(os.flags() & std::ios::fixed)
519 width = os.precision()+3;
520 else
521 width = os.precision()+7;
522 for(int irow = 1; irow<= q.num_row(); irow++)
523 {
524 os.width(width);
525 os << q(irow) << std::endl;
526 }
527 return os;
528}

◆ operator<=() [1/2]

bool CLHEP::operator<= ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 366 of file LorentzRotation.h.

367 { return lt<=b; }

◆ operator<=() [2/2]

bool CLHEP::operator<= ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 353 of file LorentzRotation.h.

354 { return lt<=r; }

◆ operator==() [1/2]

bool CLHEP::operator== ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 362 of file LorentzRotation.h.

363 { return lt==HepLorentzRotation(b); }

◆ operator==() [2/2]

bool CLHEP::operator== ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 349 of file LorentzRotation.h.

350 { return lt==HepLorentzRotation(r); }

◆ operator>() [1/2]

bool CLHEP::operator> ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 372 of file LorentzRotation.h.

373 { return lt>b; }

◆ operator>() [2/2]

bool CLHEP::operator> ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 359 of file LorentzRotation.h.

360 { return lt>r; }

◆ operator>=() [1/2]

bool CLHEP::operator>= ( const HepBoost b,
const HepLorentzRotation lt 
)
inline

Definition at line 368 of file LorentzRotation.h.

369 { return lt>=b; }

◆ operator>=() [2/2]

bool CLHEP::operator>= ( const HepRotation r,
const HepLorentzRotation lt 
)
inline

Definition at line 355 of file LorentzRotation.h.

356 { return lt>=r; }

◆ operator>>() [1/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
Hep2Vector p 
)

Definition at line 78 of file TwoVector.cc.

78 {
79 double x, y;
80 ZMinput2doubles ( is, "Hep2Vector", x, y );
81 p.set(x, y);
82 return is;
83} // operator>>()
void set(double x, double y)
void ZMinput2doubles(std::istream &is, const char *type, double &x, double &y)
Definition: ZMinput.cc:240

◆ operator>>() [2/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
Hep3Vector v 
)

Definition at line 73 of file ThreeVector.cc.

73 {
74 double x, y, z;
75 ZMinput3doubles ( is, "Hep3Vector", x, y, z );
76 v.set(x, y, z);
77 return is;
78} // operator>>()
void set(double x, double y, double z)
void ZMinput3doubles(std::istream &is, const char *type, double &x, double &y, double &z)
Definition: ZMinput.cc:37

◆ operator>>() [3/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
HepAxisAngle aa 
)

Definition at line 100 of file AxisAngle.cc.

100 {
101 Hep3Vector axis;
102 double delta;
103 double x,y,z;
104 ZMinputAxisAngle ( is, x, y, z, delta );
105 axis.set(x,y,z);
106 aa.set ( axis, delta );
107 return is;
108} // operator>>()
AA & set(const Hep3Vector axis, Scalar delta)
void ZMinputAxisAngle(std::istream &is, double &x, double &y, double &z, double &delta)
Definition: ZMinput.cc:152

◆ operator>>() [4/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
HepEulerAngles ea 
)

Definition at line 111 of file EulerAngles.cc.

111 {
112 double thePhi;
113 double theTheta;
114 double thePsi;
115 ZMinput3doubles ( is, "HepEulerAngle", thePhi , theTheta , thePsi );
116 ea.set ( thePhi , theTheta , thePsi );
117 return is;
118} // operator>>()
EA & set(double phi, double theta, double psi)

◆ operator>>() [5/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
HepLorentzVector v1 
)

Definition at line 91 of file LorentzVector.cc.

91 {
92
93// Required format is ( a, b, c; d ) that is, four numbers, preceded by
94// (, followed by ), components of the spatial vector separated by commas,
95// time component separated by semicolon. The four numbers are taken
96// as x, y, z, t.
97
98 double x, y, z, t;
99 char c;
100
101 is >> std::ws >> c;
102 // ws is defined to invoke eatwhite(istream & )
103 // see (Stroustrup gray book) page 333 and 345.
104 if (is.fail() || c != '(' ) {
105 std::cerr << "Could not find required opening parenthesis "
106 << "in input of a HepLorentzVector" << std::endl;
107 return is;
108 }
109
110 is >> x >> std::ws >> c;
111 if (is.fail() || c != ',' ) {
112 std::cerr << "Could not find x value and required trailing comma "
113 << "in input of a HepLorentzVector" << std::endl;
114 return is;
115 }
116
117 is >> y >> std::ws >> c;
118 if (is.fail() || c != ',' ) {
119 std::cerr << "Could not find y value and required trailing comma "
120 << "in input of a HepLorentzVector" << std::endl;
121 return is;
122 }
123
124 is >> z >> std::ws >> c;
125 if (is.fail() || c != ';' ) {
126 std::cerr << "Could not find z value and required trailing semicolon "
127 << "in input of a HepLorentzVector" << std::endl;
128 return is;
129 }
130
131 is >> t >> std::ws >> c;
132 if (is.fail() || c != ')' ) {
133 std::cerr << "Could not find t value and required close parenthesis "
134 << "in input of a HepLorentzVector" << std::endl;
135 return is;
136 }
137
138 v1.setX(x);
139 v1.setY(y);
140 v1.setZ(z);
141 v1.setT(t);
142 return is;
143}

◆ operator>>() [6/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
HepRandom dist 
)

Definition at line 225 of file Random.cc.

225 {
226 return dist.get(is);
227}
virtual std::istream & get(std::istream &is)
Definition: Random.cc:230

◆ operator>>() [7/7]

std::istream & CLHEP::operator>> ( std::istream &  is,
HepRandomEngine e 
)

Definition at line 106 of file RandomEngine.cc.

106 {
107 return e.get(is);
108}
virtual std::istream & get(std::istream &is)
Definition: RandomEngine.cc:65

◆ possibleKeywordInput()

template<class IS , class T >
bool CLHEP::possibleKeywordInput ( IS &  is,
const std::string &  key,
T &  t 
)

◆ qr_decomp() [1/2]

HepMatrix CLHEP::qr_decomp ( HepMatrix A)

Definition at line 564 of file MatrixLinear.cc.

565{
566 HepMatrix hsm(A->num_row(),A->num_col());
567 qr_decomp(A,&hsm);
568 // Try to make Q diagonal
569 // HepMatrix Q(A->num_row(),A->num_col(),1);
570 HepMatrix Q(A->num_row(),A->num_row(),1);
571 for (int j=hsm.num_col();j>=1;--j)
572 row_house(&Q,hsm,j,j,j,j);
573 return Q;
574}
void qr_decomp(HepMatrix *A, HepMatrix *hsm)

◆ qr_decomp() [2/2]

void CLHEP::qr_decomp ( HepMatrix A,
HepMatrix hsm 
)

Definition at line 898 of file MatrixLinear.cc.

899{
900 for (int i=1;i<=A->num_col();i++)
901 house_with_update(A,hsm,i,i);
902}
void house_with_update(HepMatrix *a, int row=1, int col=1)

Referenced by main(), qr_decomp(), and qr_inverse().

◆ qr_inverse() [1/2]

HepMatrix CLHEP::qr_inverse ( const HepMatrix A)

Definition at line 502 of file MatrixLinear.cc.

503{
504 HepMatrix Atemp=A;
505 return qr_inverse(&Atemp);
506}
HepMatrix qr_inverse(const HepMatrix &A)

Referenced by main(), and qr_inverse().

◆ qr_inverse() [2/2]

HepMatrix CLHEP::qr_inverse ( HepMatrix A)

Definition at line 508 of file MatrixLinear.cc.

509{
510 if (A->num_row()!=A->num_col()) {
511 HepGenMatrix::error("qr_inverse: The matrix is not square.");
512 }
513 HepMatrix QT=qr_decomp(A).T();
514 back_solve(*A,&QT);
515 return QT;
516}

◆ qr_solve() [1/4]

HepMatrix CLHEP::qr_solve ( const HepMatrix A,
const HepMatrix b 
)

Definition at line 732 of file MatrixLinear.cc.

733{
734 HepMatrix temp = A;
735 return qr_solve(&temp,b);
736}

◆ qr_solve() [2/4]

HepVector CLHEP::qr_solve ( const HepMatrix A,
const HepVector b 
)

Definition at line 704 of file MatrixLinear.cc.

705{
706 HepMatrix temp = A;
707 return qr_solve(&temp,b);
708}

Referenced by main(), min_line_dist(), and qr_solve().

◆ qr_solve() [3/4]

HepMatrix CLHEP::qr_solve ( HepMatrix A,
const HepMatrix b 
)

Definition at line 738 of file MatrixLinear.cc.

739{
740 HepMatrix Q=qr_decomp(A);
741 // Quick way to to Q.T*b.
742 HepMatrix b2(Q.num_col(),b.num_col(),0);
743 int nb = b.num_col();
744 int nq = Q.num_col();
745 HepMatrix::mcIter b1i = b.m.begin();
746 HepMatrix::mIter b21i = b2.m.begin();
747 for (int i=1;i<=b.num_col();i++) {
748 HepMatrix::mIter Q1r = Q.m.begin();
749 HepMatrix::mIter b2ri = b21i;
750 for (int r=1;r<=b2.num_row();r++) {
751 HepMatrix::mIter Qcr = Q1r;
752 HepMatrix::mcIter bci = b1i;
753 for (int c=1;c<=b.num_row();c++) {
754 *b2ri += (*Qcr) * (*bci);
755 if(c<b.num_row()) {
756 Qcr += nq;
757 bci += nb;
758 }
759 }
760 Q1r++;
761 if(r<b2.num_row()) b2ri += nb;
762 }
763 b1i++;
764 b21i++;
765 }
766 back_solve(*A,&b2);
767 return b2;
768}
void back_solve(const HepMatrix &R, HepVector *b)
Definition: MatrixLinear.cc:63

◆ qr_solve() [4/4]

HepVector CLHEP::qr_solve ( HepMatrix A,
const HepVector b 
)

Definition at line 710 of file MatrixLinear.cc.

711{
712 HepMatrix Q=qr_decomp(A);
713 // Quick way to to Q.T*b.
714 HepVector b2(Q.num_col(),0);
715 HepMatrix::mIter b2r = b2.m.begin();
716 HepMatrix::mIter Qr = Q.m.begin();
717 int n = Q.num_col();
718 for (int r=1;r<=b2.num_row();r++) {
719 HepMatrix::mcIter bc = b.m.begin();
720 HepMatrix::mIter Qcr = Qr;
721 for (int c=1;c<=b.num_row();c++) {
722 *b2r += (*Qcr) * (*(bc++));
723 if(c<b.num_row()) Qcr += n;
724 }
725 b2r++;
726 Qr++;
727 }
728 back_solve(*A,&b2);
729 return b2;
730}

◆ rotationOf() [1/8]

Hep3Vector CLHEP::rotationOf ( const Hep3Vector vec,
const Hep3Vector axis,
double  ddelta 
)

Definition at line 129 of file SpaceVectorR.cc.

130 {
131 Hep3Vector vv(vec);
132 return vv.rotate(axis, ddelta);
133}

◆ rotationOf() [2/8]

Hep3Vector CLHEP::rotationOf ( const Hep3Vector vec,
const HepAxisAngle ax 
)

Definition at line 124 of file SpaceVectorR.cc.

124 {
125 Hep3Vector vv(vec);
126 return vv.rotate (ax);
127}

◆ rotationOf() [3/8]

Hep3Vector CLHEP::rotationOf ( const Hep3Vector vec,
const HepEulerAngles ex 
)

Definition at line 135 of file SpaceVectorR.cc.

135 {
136 Hep3Vector vv(vec);
137 return vv.rotate (ex);
138}

◆ rotationOf() [4/8]

Hep3Vector CLHEP::rotationOf ( const Hep3Vector vec,
double  phi,
double  theta,
double  psi 
)

Definition at line 140 of file SpaceVectorR.cc.

141 {
142 Hep3Vector vv(vec);
143 return vv.rotate(phi, theta, psi);
144}

◆ rotationOf() [5/8]

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector vec,
const Hep3Vector aaxis,
double  ddelta 
)

Definition at line 44 of file LorentzVectorR.cc.

46 {
47 HepLorentzVector vv (vec);
48 return vv.rotate (aaxis, ddelta);
49}

◆ rotationOf() [6/8]

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector vec,
const HepAxisAngle ax 
)

Definition at line 51 of file LorentzVectorR.cc.

52 {
53 HepLorentzVector vv (vec);
54 return vv.rotate (ax);
55}

◆ rotationOf() [7/8]

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector vec,
const HepEulerAngles e1 
)

Definition at line 57 of file LorentzVectorR.cc.

58 {
59 HepLorentzVector vv (vec);
60 return vv.rotate (e1);
61}

◆ rotationOf() [8/8]

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector vec,
double  phi1,
double  theta1,
double  psi1 
)

Definition at line 63 of file LorentzVectorR.cc.

66 {
67 HepLorentzVector vv (vec);
68 return vv.rotate (phi1, theta1, psi1);
69}

◆ rotationXOf() [1/2]

Hep3Vector CLHEP::rotationXOf ( const Hep3Vector vec,
double  ddelta 
)

Definition at line 146 of file SpaceVectorR.cc.

146 {
147 Hep3Vector vv(vec);
148 return vv.rotateX (ddelta);
149}

◆ rotationXOf() [2/2]

HepLorentzVector CLHEP::rotationXOf ( const HepLorentzVector vec,
double  phi 
)

Definition at line 27 of file LorentzVectorB.cc.

28 {
29 HepLorentzVector vv (vec);
30 return vv.rotateX (phi);
31}

◆ rotationYOf() [1/2]

Hep3Vector CLHEP::rotationYOf ( const Hep3Vector vec,
double  ddelta 
)

Definition at line 151 of file SpaceVectorR.cc.

151 {
152 Hep3Vector vv(vec);
153 return vv.rotateY (ddelta);
154}

◆ rotationYOf() [2/2]

HepLorentzVector CLHEP::rotationYOf ( const HepLorentzVector vec,
double  phi 
)

Definition at line 33 of file LorentzVectorB.cc.

34 {
35 HepLorentzVector vv (vec);
36 return vv.rotateY (phi);
37}

◆ rotationZOf() [1/2]

Hep3Vector CLHEP::rotationZOf ( const Hep3Vector vec,
double  ddelta 
)

Definition at line 156 of file SpaceVectorR.cc.

156 {
157 Hep3Vector vv(vec);
158 return vv.rotateZ (ddelta);
159}

◆ rotationZOf() [2/2]

HepLorentzVector CLHEP::rotationZOf ( const HepLorentzVector vec,
double  phi 
)

Definition at line 39 of file LorentzVectorB.cc.

40 {
41 HepLorentzVector vv (vec);
42 return vv.rotateZ (phi);
43}

◆ row_givens()

void CLHEP::row_givens ( HepMatrix A,
double  c,
double  s,
int  k1,
int  k2,
int  col_min = 1,
int  col_max = 0 
)

Definition at line 587 of file MatrixLinear.cc.

588 {
589 /* not tested */
590 if (col_max==0) col_max = A->num_col();
591 int n = A->num_col();
592 HepMatrix::mIter Ak1j = A->m.begin() + (k1-1) * n + (col_min-1);
593 HepMatrix::mIter Ak2j = A->m.begin() + (k2-1) * n + (col_min-1);
594 for (int j=col_min;j<=col_max;j++) {
595 double tau1=(*Ak1j); double tau2=(*Ak2j);
596 (*(Ak1j++))=c*tau1-ds*tau2;(*(Ak2j++))=ds*tau1+c*tau2;
597 }
598}

◆ row_house() [1/3]

void CLHEP::row_house ( HepMatrix a,
const HepMatrix v,
double  vnormsq,
int  row,
int  col,
int  row_start,
int  col_start 
)

Definition at line 652 of file MatrixLinear.cc.

653 {
654 double beta=-2/vnormsq;
655
656 // This is a fast way of calculating w=beta*A.sub(row,n,col,n).T()*v
657 HepVector w(a->num_col()-col+1,0);
658 int na = a->num_col();
659 int nv = v.num_col();
660 HepMatrix::mIter wptr = w.m.begin();
661 HepMatrix::mIter arcb = a->m.begin() + (row-1) * na + (col-1);
662 HepMatrix::mcIter vpcb = v.m.begin() + (row_start-1) * nv + (col_start-1);
663 int c;
664 for (c=col;c<=a->num_col();c++) {
665 HepMatrix::mIter arc = arcb;
666 HepMatrix::mcIter vpc = vpcb;
667 for (int r=row;r<=a->num_row();r++) {
668 (*wptr)+=(*arc)*(*vpc);
669 if(r<a->num_row()) {
670 arc += na;
671 vpc += nv;
672 }
673 }
674 wptr++;
675 arcb++;
676 }
677 w*=beta;
678
679 arcb = a->m.begin() + (row-1) * na + (col-1);
680 HepMatrix::mcIter vpc = v.m.begin() + (row_start-1) * nv + (col_start-1);
681 for (int r=row; r<=a->num_row();r++) {
682 HepMatrix::mIter arc = arcb;
683 HepMatrix::mIter wptr2 = w.m.begin();
684 for (c=col;c<=a->num_col();c++) {
685 (*(arc++))+=(*vpc)*(*(wptr2++));
686 }
687 if(r<a->num_row()) {
688 arcb += na;
689 vpc += nv;
690 }
691 }
692}

◆ row_house() [2/3]

void CLHEP::row_house ( HepMatrix a,
const HepMatrix v,
int  row,
int  col,
int  row_start,
int  col_start 
)

Definition at line 904 of file MatrixLinear.cc.

906{
907 double normsq=0;
908 int end = row_start+a->num_row()-row;
909 for (int i=row_start; i<=end; i++)
910 normsq += v(i,col)*v(i,col);
911 // If v is 0, then we can skip doing row_house.
912 if (normsq !=0)
913 row_house(a,v,normsq,row,col,row_start,col_start);
914}

◆ row_house() [3/3]

void CLHEP::row_house ( HepMatrix a,
const HepVector v,
double  vnormsq,
int  row = 1,
int  col = 1 
)

Definition at line 613 of file MatrixLinear.cc.

614 {
615 double beta=-2/vnormsq;
616
617 // This is a fast way of calculating w=beta*A.sub(row,n,col,n).T()*v
618
619 HepVector w(a->num_col()-col+1,0);
620/* not tested */
621 int na = a->num_col();
622 HepMatrix::mIter wptr = w.m.begin();
623 HepMatrix::mIter arcb = a->m.begin() + (row-1) * na + (col-1);
624 int c;
625 for (c=col;c<=a->num_col();c++) {
626 HepMatrix::mcIter vp = v.m.begin();
627 HepMatrix::mIter arc = arcb;
628 for (int r=row;r<=a->num_row();r++) {
629 (*wptr)+=(*arc)*(*(vp++));
630 if(r<a->num_row()) arc += na;
631 }
632 wptr++;
633 arcb++;
634 }
635 w*=beta;
636
637 // Fast way of calculating A.sub=A.sub+v*w.T()
638
639 arcb = a->m.begin() + (row-1) * na + (col-1);
640 HepMatrix::mcIter vp = v.m.begin();
641 for (int r=row; r<=a->num_row();r++) {
642 HepMatrix::mIter wptr2 = w.m.begin();
643 HepMatrix::mIter arc = arcb;
644 for (c=col;c<=a->num_col();c++) {
645 (*(arc++))+=(*vp)*(*(wptr2++));
646 }
647 vp++;
648 if(r<a->num_row()) arcb += na;
649 }
650}

Referenced by qr_decomp(), row_house(), and tridiagonal().

◆ solve()

HepVector CLHEP::solve ( const HepMatrix a,
const HepVector v 
)

Definition at line 575 of file Vector.cc.

578{
579#else
580{
581 HepVector vret(v);
582#endif
583 static CLHEP_THREAD_LOCAL int max_array = 20;
584 static CLHEP_THREAD_LOCAL int *ir = new int [max_array+1];
585
586 if(a.ncol != a.nrow)
587 HepGenMatrix::error("Matrix::solve Matrix is not NxN");
588 if(a.ncol != v.nrow)
589 HepGenMatrix::error("Matrix::solve Vector has wrong number of rows");
590
591 int n = a.ncol;
592 if (n > max_array) {
593 delete [] ir;
594 max_array = n;
595 ir = new int [max_array+1];
596 }
597 double det;
598 HepMatrix mt(a);
599 int i = mt.dfact_matrix(det, ir);
600 if (i!=0) {
601 for (i=1;i<=n;i++) vret(i) = 0;
602 return vret;
603 }
604 double s21, s22;
605 int nxch = ir[n];
606 if (nxch!=0) {
607 for (int hmm=1;hmm<=nxch;hmm++) {
608 int ij = ir[hmm];
609 i = ij >> 12;
610 int j = ij%4096;
611 double te = vret(i);
612 vret(i) = vret(j);
613 vret(j) = te;
614 }
615 }
616 vret(1) = mt(1,1) * vret(1);
617 if (n!=1) {
618 for (i=2;i<=n;i++) {
619 s21 = -vret(i);
620 for (int j=1;j<i;j++) {
621 s21 += mt(i,j) * vret(j);
622 }
623 vret(i) = -mt(i,i)*s21;
624 }
625 for (i=1;i<n;i++) {
626 int nmi = n-i;
627 s22 = -vret(nmi);
628 for (int j=1;j<=i;j++) {
629 s22 += mt(nmi,n-j+1) * vret(n-j+1);
630 }
631 vret(nmi) = -s22;
632 }
633 }
634 return vret;
635}

Referenced by main().

◆ transformSmall()

double CLHEP::transformSmall ( double  r)

Definition at line 223 of file flatToGaussian.cc.

223 {
224
225 // Solve for -v in the asymtotic formula
226 //
227 // errInt (-v) = std::exp(-v*v/2) 1 1*3 1*3*5
228 // ------------ * (1 - ---- + ---- - ----- + ... )
229 // v*std::sqrt(2*pi) v**2 v**4 v**6
230
231 // The value of r (=errInt(-v)) supplied is going to less than 2.0E-13,
232 // which is such that v < -7.25. Since the value of r is meaningful only
233 // to an absolute error of 1E-16 (double precision accuracy for a number
234 // which on the high side could be of the form 1-epsilon), computing
235 // v to more than 3-4 digits of accuracy is suspect; however, to ensure
236 // smoothness with the table generator (which uses quite a few terms) we
237 // also use terms up to 1*3*5* ... *13/v**14, and insist on accuracy of
238 // solution at the level of 1.0e-7.
239
240 // This routine is called less than one time in a trillion firings, so
241 // speed is of no concern. As a matter of technique, we terminate the
242 // iterations in case they would be infinite, but this should not happen.
243
244 double eps = 1.0e-7;
245 double guess = 7.5;
246 double v;
247
248 for ( int i = 1; i < 50; i++ ) {
249 double vn2 = 1.0/(guess*guess);
250 double s1 = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
251 s1 += 11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
252 s1 += -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
253 s1 += 7*5*3 * vn2*vn2*vn2*vn2;
254 s1 += -5*3 * vn2*vn2*vn2;
255 s1 += 3 * vn2*vn2 - vn2 + 1.0;
256 v = std::sqrt ( 2.0 * std::log ( s1 / (r*guess*std::sqrt(CLHEP::twopi)) ) );
257 if ( std::abs(v-guess) < eps ) break;
258 guess = v;
259 }
260
261 return -v;
262
263} // transformSmall()

Referenced by CLHEP::HepStat::flatToGaussian().

◆ tridiagonal() [1/2]

HepMatrix CLHEP::tridiagonal ( HepSymMatrix a)

Definition at line 859 of file MatrixLinear.cc.

860{
861 HepMatrix U(a->num_row(),a->num_col(),1);
862 if (a->num_col()>2)
863 {
864 HepMatrix hsm(a->num_col(),a->num_col()-2,0);
865 tridiagonal(a,&hsm);
866 for (int j=hsm.num_col();j>=1;--j) {
867 row_house(&U,hsm,j,j,j,j);
868 }
869 }
870 return U;
871}

◆ tridiagonal() [2/2]

void CLHEP::tridiagonal ( HepSymMatrix a,
HepMatrix hsm 
)

Definition at line 777 of file MatrixLinear.cc.

778{
779 int nh = hsm->num_col();
780 for (int k=1;k<=a->num_col()-2;k++) {
781
782 // If this row is already in tridiagonal form, we can skip the
783 // transformation.
784
785 double scale=0;
786 HepMatrix::mIter ajk = a->m.begin() + k * (k+5) / 2;
787 int j;
788 for (j=k+2;j<=a->num_row();j++) {
789 scale+=fabs(*ajk);
790 if(j<a->num_row()) ajk += j;
791 }
792 if (scale ==0) {
793 HepMatrix::mIter hsmjkp = hsm->m.begin() + k * (nh+1) - 1;
794 for (j=k+1;j<=hsm->num_row();j++) {
795 *hsmjkp = 0;
796 if(j<hsm->num_row()) hsmjkp += nh;
797 }
798 } else {
799 house_with_update2(a,hsm,k+1,k);
800 double normsq=0;
801 HepMatrix::mIter hsmrptrkp = hsm->m.begin() + k * (nh+1) - 1;
802 int rptr;
803 for (rptr=k+1;rptr<=hsm->num_row();rptr++) {
804 normsq+=(*hsmrptrkp)*(*hsmrptrkp);
805 if(rptr<hsm->num_row()) hsmrptrkp += nh;
806 }
807 HepVector p(a->num_row()-k,0);
808 rptr=k+1;
809 HepMatrix::mIter pr = p.m.begin();
810 int r;
811 for (r=1;r<=p.num_row();r++) {
812 HepMatrix::mIter hsmcptrkp = hsm->m.begin() + k * (nh+1) - 1;
813 int cptr;
814 for (cptr=k+1;cptr<=rptr;cptr++) {
815 (*pr)+=a->fast(rptr,cptr)*(*hsmcptrkp);
816 if(cptr<a->num_col()) hsmcptrkp += nh;
817 }
818 for (;cptr<=a->num_col();cptr++) {
819 (*pr)+=a->fast(cptr,rptr)*(*hsmcptrkp);
820 if(cptr<a->num_col()) hsmcptrkp += nh;
821 }
822 (*pr)*=2/normsq;
823 rptr++;
824 pr++;
825 }
826 double pdotv=0;
827 pr = p.m.begin();
828 hsmrptrkp = hsm->m.begin() + k * (nh+1) - 1;
829 for (r=1;r<=p.num_row();r++) {
830 pdotv+=(*(pr++))*(*hsmrptrkp);
831 if(r<p.num_row()) hsmrptrkp += nh;
832 }
833 pr = p.m.begin();
834 hsmrptrkp = hsm->m.begin() + k * (nh+1) - 1;
835 for (r=1;r<=p.num_row();r++) {
836 (*(pr++))-=pdotv*(*hsmrptrkp)/normsq;
837 if(r<p.num_row()) hsmrptrkp += nh;
838 }
839 rptr=k+1;
840 pr = p.m.begin();
841 hsmrptrkp = hsm->m.begin() + k * (nh+1) - 1;
842 for (r=1;r<=p.num_row();r++) {
843 int cptr=k+1;
844 HepMatrix::mIter mpc = p.m.begin();
845 HepMatrix::mIter hsmcptrkp = hsm->m.begin() + k * (nh+1) - 1;
846 for (int c=1;c<=r;c++) {
847 a->fast(rptr,cptr)-= (*hsmrptrkp)*(*(mpc++))+(*pr)*(*hsmcptrkp);
848 cptr++;
849 if(c<r) hsmcptrkp += nh;
850 }
851 pr++;
852 rptr++;
853 if(r<p.num_row()) hsmrptrkp += nh;
854 }
855 }
856 }
857}
void house_with_update2(HepSymMatrix *a, HepMatrix *v, int row=1, int col=1)

Referenced by tridiagonal().

◆ vT_times_v()

HepSymMatrix CLHEP::vT_times_v ( const HepVector v)

Definition at line 539 of file SymMatrix.cc.

542{
543#else
544{
545 HepSymMatrix mret(v.num_row());
546#endif
547 HepMatrix::mIter mr=mret.m.begin();
548 HepMatrix::mcIter vt1,vt2;
549 for(vt1=v.m.begin();vt1<v.m.begin()+v.num_row();vt1++)
550 for(vt2=v.m.begin();vt2<=vt1;vt2++)
551 *(mr++)=(*vt1)*(*vt2);
552 return mret;
553}

Referenced by main(), and min_line_dist().

◆ ZMinput2doubles()

void CLHEP::ZMinput2doubles ( std::istream &  is,
const char *  type,
double x,
double y 
)

Definition at line 240 of file ZMinput.cc.

241 {
242
243// Accepted formats are
244// x y
245// x, y (comma is optional, and whitespace ignored if comma present)
246// ( x, y ) (comma optional)
247
248 char c;
249 bool parenthesis = false;
250
251 if ( !eatwhitespace(is) ) {
252 std::cerr << "istream ended before trying to input " << type << "\n";
253 return;
254 }
255
256 if ( !is.get(c) ) { fouledup(); return; }
257 if ( c == '(' ) {
258 parenthesis = true;
259 if ( !eatwhitespace(is) ) {
260 std::cerr << "istream ended after ( trying to input " << type << "\n";
261 return;
262 }
263 } else {
264 is.putback(c);
265 }
266
267 // At this point, parenthesis or not, the next item read is supposed to
268 // be the number x.
269
270 if (!(is >> x)) {
271 std::cerr << "Could not read first value in input of " << type << "\n";
272 return;
273 }
274
275 if ( !eatwhitespace(is) ) {
276 std::cerr << "istream ended before second value of " << type << "\n";
277 return;
278 }
279
280 if ( !is.get(c) ) { fouledup(); return; }
281 if ( c == ',' ) {
282 if ( !eatwhitespace(is) ) {
283 std::cerr << "istream ended ater one value and comma in "
284 << type << "\n";
285 return;
286 }
287 } else {
288 is.putback(c);
289 }
290
291 // At this point, comma or not, the next item read is supposed to
292 // be the number y.
293
294 if (!(is >> y)) {
295 std::cerr << "Could not read second value in input of " << type << "\n";
296 return;
297 }
298
299 // Finally, check for the closing parenthesis if there was an open paren.
300
301 if (parenthesis) {
302 if ( !eatwhitespace(is) ) {
303 std::cerr << "No closing parenthesis in input of " << type << "\n";
304 return;
305 }
306 if ( !is.get(c) ) { fouledup(); return; }
307 if ( c != ')' ) {
308 std::cerr << "Missing closing parenthesis in input of "
309 << type << "\n";
310 // Now a trick to do (as nearly as we can) what
311 // is.putback(c); is.setstate(std::ios_base::failbit);
312 // would do (because using ios_base will confuse old CLHEP compilers):
313 if ( isdigit(c) || (c=='-') || (c=='+') ) {
314 is.putback('@');
315 } else {
316 is.putback('c');
317 }
318 int m;
319 is >> m; // This fails, leaving the state bad, and the istream
320 // otherwise unchanged, except if the next char might
321 // have started a valid int, it turns to @
322 return;
323 }
324 }
325
326 return;
327
328}

Referenced by operator>>().

◆ ZMinput3doubles()

void CLHEP::ZMinput3doubles ( std::istream &  is,
const char *  type,
double x,
double y,
double z 
)

Definition at line 37 of file ZMinput.cc.

38 {
39
40// Accepted formats are
41// x y z
42// x, y, z (each comma is optional, and whitespace ignored if comma present)
43// ( x, y, z ) (commas optional)
44
45 char c;
46 bool parenthesis = false;
47
48 if ( !eatwhitespace(is) ) {
49 std::cerr << "istream ended before trying to input " << type << "\n";
50 return;
51 }
52
53 if ( !is.get(c) ) { fouledup(); return; }
54 if ( c == '(' ) {
55 parenthesis = true;
56 if ( !eatwhitespace(is) ) {
57 std::cerr << "istream ended after ( trying to input " << type << "\n";
58 return;
59 }
60 } else {
61 is.putback(c);
62 }
63
64 // At this point, parenthesis or not, the next item read is supposed to
65 // be the number x.
66
67 if (!(is >> x)) {
68 std::cerr << "Could not read first value in input of " << type << "\n";
69 return;
70 }
71
72 if ( !eatwhitespace(is) ) {
73 std::cerr << "istream ended before second value of " << type << "\n";
74 return;
75 }
76
77 if ( !is.get(c) ) { fouledup(); return; }
78 if ( c == ',' ) {
79 if ( !eatwhitespace(is) ) {
80 std::cerr << "istream ended ater one value and comma in "
81 << type << "\n";
82 return;
83 }
84 } else {
85 is.putback(c);
86 }
87
88 // At this point, comma or not, the next item read is supposed to
89 // be the number y.
90
91 if (!(is >> y)) {
92 std::cerr << "Could not read second value in input of " << type << "\n";
93 return;
94 }
95
96 if ( !eatwhitespace(is) ) {
97 std::cerr << "istream ended before third value of " << type << "\n";
98 return;
99 }
100
101 if ( !is.get(c) ) { fouledup(); return; }
102 if ( c == ',' ) {
103 if ( !eatwhitespace(is) ) {
104 std::cerr << "istream ended ater two values and comma in "
105 << type << "\n";
106 return;
107 }
108 } else {
109 is.putback(c);
110 }
111
112 // At this point, comma or not, the next item read is supposed to
113 // be the number z.
114
115 if (!(is >> z)) {
116 std::cerr << "Could not read third value in input of " << type << "\n";
117 return;
118 }
119
120 // Finally, check for the closing parenthesis if there was an open paren.
121
122 if (parenthesis) {
123 if ( !eatwhitespace(is) ) {
124 std::cerr << "No closing parenthesis in input of " << type << "\n";
125 return;
126 }
127 if ( !is.get(c) ) { fouledup(); return; }
128 if ( c != ')' ) {
129 std::cerr << "Missing closing parenthesis in input of "
130 << type << "\n";
131 // Now a trick to do (as nearly as we can) what
132 // is.putback(c); is.setstate(std::ios_base::failbit);
133 // would do (because using ios_base will confuse old CLHEP compilers):
134 if ( isdigit(c) || (c=='-') || (c=='+') ) {
135 is.putback('@');
136 } else {
137 is.putback('c');
138 }
139 int m;
140 is >> m; // This fails, leaving the state bad, and the istream
141 // otherwise unchanged, except if the next char might
142 // have started a valid int, it turns to @
143 return;
144 }
145 }
146
147 return;
148
149}

Referenced by operator>>(), and ZMinputAxisAngle().

◆ ZMinputAxisAngle()

void CLHEP::ZMinputAxisAngle ( std::istream &  is,
double x,
double y,
double z,
double delta 
)

Definition at line 152 of file ZMinput.cc.

154 {
155// Accepted formats are
156// parenthesis optional, then
157// any acceptable format for a Hep3Vector, then
158// optional comma, then
159// delta, then
160// close parenthesis if opened at start.
161//
162// But if there is an open parenthesis, it must be for the overall
163// object. That is, if the axis has parentheses, the form must be
164// ( (x,y,z) , delta )
165
166 char c;
167 bool parenthesis = false;
168
169 if ( !eatwhitespace(is) ) {
170 std::cerr << "istream ended before trying to input AxisAngle \n";
171 return;
172 }
173
174 if ( !is.get(c) ) { fouledup(); return; }
175 if ( c == '(' ) {
176 parenthesis = true;
177 if ( !eatwhitespace(is) ) {
178 std::cerr << "istream ended after ( trying to input AxisAngle \n";
179 return;
180 }
181 } else {
182 is.putback(c);
183 }
184
185 // At this point, parenthesis or not, the next item read is supposed to
186 // be a valid Hep3Vector axis.
187
188 ZMinput3doubles ( is, "axis of AxisAngle", x, y, z );
189 if (!is) return;
190
191 if ( !eatwhitespace(is) ) {
192 std::cerr << "istream ended before delta of AxisAngle \n";
193 return;
194 }
195
196 if ( !is.get(c) ) { fouledup(); return; }
197 if ( c == ',' ) {
198 if ( !eatwhitespace(is) ) {
199 std::cerr << "istream ended ater axis and comma in AxisAngle \n";
200 return;
201 }
202 } else {
203 is.putback(c);
204 }
205
206 // At this point, comma or not, the next item read is supposed to
207 // be the number delta.
208
209 if (!(is >> delta)) {
210 std::cerr << "Could not delta value in input of AxisAngle \n";
211 return;
212 }
213
214 // Finally, check for the closing parenthesis if there was an open paren.
215
216 if (parenthesis) {
217 if ( !eatwhitespace(is) ) {
218 std::cerr << "No closing parenthesis in input of AxisAngle \n";
219 return;
220 }
221 if ( !is.get(c) ) { fouledup(); return; }
222 if ( c != ')' ) {
223 std::cerr << "Missing closing parenthesis in input of AxisAngle \n";
224 if ( isdigit(c) || (c=='-') || (c=='+') ) {
225 is.putback('@');
226 } else {
227 is.putback('c');
228 }
229 int m;
230 is >> m; // This fails, leaving the state bad.
231 return;
232 }
233 }
234
235 return;
236
237}

Variable Documentation

◆ HepXHat

const Hep3Vector CLHEP::HepXHat ( 1.  0,
0.  0,
0.  0 
)

Definition at line 419 of file ThreeVector.h.

◆ HepYHat

const Hep3Vector CLHEP::HepYHat ( 0.  0,
1.  0,
0.  0 
)

Definition at line 419 of file ThreeVector.h.

◆ HepZHat

const Hep3Vector CLHEP::HepZHat ( 0.  0,
0.  0,
1.  0 
)

Definition at line 419 of file ThreeVector.h.