Commit 952bf539 authored by Lynn Garren's avatar Lynn Garren

remove obsolete register keyword

parent d4116295
2014-02-24 Lynn Garren <garren@fnal.gov>
* Vector, Random, Matrix: remove register declaration of ints and doubles
use of register is now redundant and ignored by modern compilers
==============================
18.11.13 Release CLHEP-2.1.4.1
==============================
......
2014-02-24 Lynn Garren <garren@fnal.gov>
* remove register declaration of doubles
use of register is now redundant and ignored by modern compilers
==============================
14.11.13 Release CLHEP-2.1.4.1
==============================
......
......@@ -646,7 +646,7 @@ HepSymMatrix HepDiagMatrix::similarity(const HepMatrix &hm1) const
HepMatrix::mcIter mc = hm1.m.begin();
for(int c=1;c<=r;c++) {
HepMatrix::mcIter mi = m.begin();
register double tmp = 0;
double tmp = 0;
HepMatrix::mcIter mr = mrr;
for(int i=0;i<hm1.num_col();i++)
tmp+=*(mr++) * *(mc++) * *(mi++);
......@@ -658,7 +658,7 @@ HepSymMatrix HepDiagMatrix::similarity(const HepMatrix &hm1) const
double HepDiagMatrix::similarity(const HepVector &hm1) const
{
register double mret;
double mret;
CHK_DIM_1(num_row(),hm1.num_row(),similarity);
HepMatrix::mcIter mi = m.begin();
HepMatrix::mcIter mv = hm1.m.begin();
......@@ -687,7 +687,7 @@ HepSymMatrix HepDiagMatrix::similarityT(const HepMatrix &hm1) const
for(int c=1;c<=r;c++)
{
HepMatrix::mcIter mi = m.begin();
register double tmp = hm1(1,r)*hm1(1,c)* *(mi++);
double tmp = hm1(1,r)*hm1(1,c)* *(mi++);
for(int i=2;i<=hm1.num_row();i++)
tmp+=hm1(i,r)*hm1(i,c)* *(mi++);
mret.fast(r,c) = tmp;
......
......@@ -366,7 +366,7 @@ HepMatrix operator*(const HepMatrix &hm1,const HepMatrix &hm2)
{
for (int j=0; j<m1cols; j++)
{
register double temp = hm1.m[i*m1cols+j];
double temp = hm1.m[i*m1cols+j];
HepMatrix::mIter pt = mret.m.begin() + i*m2cols;
// Loop over k (the column index in matrix hm2)
......@@ -498,7 +498,7 @@ int HepMatrix::dfinv_matrix(int *ir) {
if (n==1) return 0;
double s31, s32;
register double s33, s34;
double s33, s34;
mIter hm11 = m.begin();
mIter hm12 = hm11 + 1;
......
......@@ -751,7 +751,7 @@ HepSymMatrix HepSymMatrix::similarity(const HepMatrix &hm1) const
for(int r=1;r<=mret.num_row();r++) {
HepMatrix::mcIter hm1c1 = hm1.m.begin();
for(int c=1;c<=r;c++) {
register double tmp = 0.0;
double tmp = 0.0;
HepMatrix::mIter tempri = tempr1;
HepMatrix::mcIter hm1ci = hm1c1;
for(int i=1;i<=hm1.num_col();i++) {
......@@ -781,7 +781,7 @@ HepSymMatrix HepSymMatrix::similarity(const HepSymMatrix &hm1) const
HepMatrix::mcIter hm1c1 = hm1.m.begin();
int c;
for(c=1;c<=r;c++) {
register double tmp = 0.0;
double tmp = 0.0;
HepMatrix::mIter tempri = tempr1;
HepMatrix::mcIter hm1ci = hm1c1;
int i;
......@@ -802,7 +802,7 @@ HepSymMatrix HepSymMatrix::similarity(const HepSymMatrix &hm1) const
double HepSymMatrix::similarity(const HepVector &hm1)
const {
register double mret = 0.0;
double mret = 0.0;
HepVector temp = (*this) *hm1;
// If hm1*(*this) has correct dimensions, then so will the hm1.T multiplication.
// So there is no need to check dimensions again.
......@@ -828,7 +828,7 @@ HepSymMatrix HepSymMatrix::similarityT(const HepMatrix &hm1) const
for(int r=1;r<=mret.num_row();r++) {
HepMatrix::mcIter m11c = hm1.m.begin();
for(int c=1;c<=r;c++) {
register double tmp = 0.0;
double tmp = 0.0;
for(int i=1;i<=hm1.num_row();i++) {
HepMatrix::mIter tempir = temp1r + n*(i-1);
HepMatrix::mcIter hm1ic = m11c + n*(i-1);
......
2014-02-24 Lynn Garren <garren@fnal.gov>
* remove register declaration of ints and doubles
use of register is now redundant and ignored by modern compilers
==============================
14.11.13 Release CLHEP-2.1.4.1
==============================
......
......@@ -104,7 +104,7 @@ Hurd160Engine::Hurd160Engine( int rowIndex, int colIndex )
Hurd160Engine::~Hurd160Engine() { }
void Hurd160Engine::advance() {
register unsigned int W0, W1, W2, W3, W4;
unsigned int W0, W1, W2, W3, W4;
W0 = words[0];
W1 = words[1];
......
......@@ -113,7 +113,7 @@ Hurd288Engine::~Hurd288Engine() { }
void Hurd288Engine::advance() {
register unsigned int W0, W1, W2, W3, W4, W5, W6, W7, W8;
unsigned int W0, W1, W2, W3, W4, W5, W6, W7, W8;
W0 = words[0];
W1 = words[1];
......
......@@ -108,7 +108,7 @@ double MTwistEngine::flat() {
unsigned int y;
if( count624 >= N ) {
register int i;
int i;
for( i=0; i < NminusM; ++i ) {
y = (mt[i] & 0x80000000) | (mt[i+1] & 0x7fffffff);
......@@ -223,7 +223,7 @@ MTwistEngine::operator float() {
unsigned int y;
if( count624 >= N ) {
register int i;
int i;
for( i=0; i < NminusM; ++i ) {
y = (mt[i] & 0x80000000) | (mt[i+1] & 0x7fffffff);
......@@ -254,7 +254,7 @@ MTwistEngine::operator unsigned int() {
unsigned int y;
if( count624 >= N ) {
register int i;
int i;
for( i=0; i < NminusM; ++i ) {
y = (mt[i] & 0x80000000) | (mt[i+1] & 0x7fffffff);
......
......@@ -101,7 +101,7 @@ double RandGaussQ::transformQuick (double r) {
sign = -1.0;
}
register int index;
int index;
double dx;
if ( r >= Table1step ) {
......
......@@ -110,8 +110,8 @@ void RandGeneral::prepareTable(const double* aProbFunc) {
theIntegralPdf.resize(nBins+1);
theIntegralPdf[0] = 0;
register int ptn;
register double weight;
int ptn;
double weight;
for ( ptn = 0; ptn<nBins; ++ptn ) {
weight = aProbFunc[ptn];
......@@ -231,7 +231,7 @@ double RandGeneral::mapRandom(double rand) const {
void RandGeneral::shootArray( HepRandomEngine* anEngine,
const int size, double* vect )
{
register int i;
int i;
for (i=0; i<size; ++i) {
vect[i] = shoot(anEngine);
......@@ -240,7 +240,7 @@ void RandGeneral::shootArray( HepRandomEngine* anEngine,
void RandGeneral::fireArray( const int size, double* vect )
{
register int i;
int i;
for (i=0; i<size; ++i) {
vect[i] = fire();
......
......@@ -240,7 +240,7 @@ void RanecuEngine::flatArray(const int size, double* vect)
long seed1 = table[index][0];
long seed2 = table[index][1];
int k1, k2;
register int i;
int i;
for (i=0; i<size; ++i)
{
......
......@@ -187,7 +187,7 @@ void Ranlux64Engine::update() {
// but we can treat the special case of endIters = 1 separately for superior
// efficiency in the cases of levels 0 and 2.
register double y1;
double y1;
if ( endIters == 1 ) { // Luxury levels 0 and 2 will go here
y1 = randoms[ 4] - randoms[11] - carry;
......@@ -252,10 +252,10 @@ void Ranlux64Engine::update() {
void Ranlux64Engine::advance(int dozens) {
register double y1, y2, y3;
register double cValue = twoToMinus_48();
register double zero = 0.0;
register double one = 1.0;
double y1, y2, y3;
double cValue = twoToMinus_48();
double zero = 0.0;
double one = 1.0;
// Technical note: We use Luscher's trick to only do the
// carry subtraction when we really have to. Like him, we use
......
......@@ -126,7 +126,7 @@ std::cout << "r = " << r << "sign negative \n";
// The following big if block will locate tptr, h, and dx from whichever
// table is applicable:
register int index;
int index;
if ( r >= Table4step ) {
......
2014-02-24 Lynn Garren <garren@fnal.gov>
* remove register declaration of doubles
use of register is now redundant and ignored by modern compilers
==============================
14.11.13 Release CLHEP-2.1.4.1
==============================
......
......@@ -233,10 +233,10 @@ inline bool HepBoost::isNear(const HepBoost & b, double epsilon) const{
// - Protected method:
inline HepLorentzVector
HepBoost::vectorMultiplication(const HepLorentzVector & p) const {
register double x = p.x();
register double y = p.y();
register double z = p.z();
register double t = p.t();
double x = p.x();
double y = p.y();
double z = p.z();
double t = p.t();
return HepLorentzVector( rep_.xx_*x + rep_.xy_*y + rep_.xz_*z + rep_.xt_*t,
rep_.xy_*x + rep_.yy_*y + rep_.yz_*z + rep_.yt_*t,
rep_.xz_*x + rep_.yz_*y + rep_.zz_*z + rep_.zt_*t,
......
......@@ -153,7 +153,7 @@ inline bool HepBoostX::isNear(const HepBoost & b,
// ---------- Properties:
inline double HepBoostX::norm2() const {
register double bg = beta_*gamma_;
double bg = beta_*gamma_;
return bg*bg;
}
......
......@@ -154,7 +154,7 @@ inline bool HepBoostY::isNear(const HepBoost & b,
// ---------- Properties:
double HepBoostY::norm2() const {
register double bg = beta_*gamma_;
double bg = beta_*gamma_;
return bg*bg;
}
......
......@@ -153,7 +153,7 @@ inline bool HepBoostZ::isNear(const HepBoost & b,
// ---------- Properties:
double HepBoostZ::norm2() const {
register double bg = beta_*gamma_;
double bg = beta_*gamma_;
return bg*bg;
}
......
......@@ -264,10 +264,10 @@ inline bool HepLorentzRotation::isIdentity() const {
inline HepLorentzVector
HepLorentzRotation::vectorMultiplication(const HepLorentzVector & p) const {
register double x(p.x());
register double y(p.y());
register double z(p.z());
register double t(p.t());
double x(p.x());
double y(p.y());
double z(p.z());
double t(p.t());
return HepLorentzVector(mxx*x + mxy*y + mxz*z + mxt*t,
myx*x + myy*y + myz*z + myt*t,
mzx*x + mzy*y + mzz*z + mzt*t,
......
......@@ -189,9 +189,9 @@ inline Hep3Vector HepRotation::operator * (const Hep3Vector & p) const {
}
inline Hep3Vector HepRotation::operator () (const Hep3Vector & p) const {
register double x = p.x();
register double y = p.y();
register double z = p.z();
double x = p.x();
double y = p.y();
double z = p.z();
return Hep3Vector(rxx*x + rxy*y + rxz*z,
ryx*x + ryy*y + ryz*z,
rzx*x + rzy*y + rzz*z);
......
......@@ -175,7 +175,7 @@ inline double HepRotationX::proper( double ddelta ) {
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = ddelta / (CLHEP::twopi);
double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
......
......@@ -145,7 +145,7 @@ inline double HepRotationY::proper( double ddelta ) {
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = ddelta / (CLHEP::twopi);
double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
......
......@@ -144,7 +144,7 @@ inline double HepRotationZ::proper( double ddelta ) {
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = ddelta / (CLHEP::twopi);
double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
......
......@@ -20,13 +20,13 @@ double HepAxisAngle::tolerance = Hep3Vector::ToleranceTicks * 1.0e-08;
static void ZMpvAxisAngleRep( const HepAxisAngle & aa, double array[] ) {
register double sinDelta = std::sin( aa.delta() );
register double cosDelta = std::cos( aa.delta() );
register double oneMinusCosDelta = 1.0 - cosDelta;
double sinDelta = std::sin( aa.delta() );
double cosDelta = std::cos( aa.delta() );
double oneMinusCosDelta = 1.0 - cosDelta;
register double uX = aa.getAxis().getX();
register double uY = aa.getAxis().getY();
register double uZ = aa.getAxis().getZ();
double uX = aa.getAxis().getX();
double uY = aa.getAxis().getY();
double uZ = aa.getAxis().getZ();
array[0] = oneMinusCosDelta * uX * uX + cosDelta;
array[1] = oneMinusCosDelta * uX * uY - sinDelta * uZ;
......
......@@ -138,9 +138,9 @@ bool HepBoost::isNear (const HepLorentzRotation & lt,
// ---------- Properties:
double HepBoost::norm2() const {
register double bgx = rep_.xt_;
register double bgy = rep_.yt_;
register double bgz = rep_.zt_;
double bgx = rep_.xt_;
double bgy = rep_.yt_;
double bgz = rep_.zt_;
return bgx*bgx+bgy*bgy+bgz*bgz;
}
......
......@@ -43,9 +43,9 @@ double HepEulerAngles::tolerance = Hep3Vector::ToleranceTicks * 1.0e-8;
static void ZMpvEulerAnglesRep ( const HepEulerAngles & ex, double array[] ) {
register double sinPhi = std::sin( ex.phi() ) , cosPhi = std::cos( ex.phi() );
register double sinTheta = std::sin( ex.theta() ), cosTheta = std::cos( ex.theta() );
register double sinPsi = std::sin( ex.psi() ) , cosPsi = std::cos( ex.psi() );
double sinPhi = std::sin( ex.phi() ) , cosPhi = std::cos( ex.phi() );
double sinTheta = std::sin( ex.theta() ), cosTheta = std::cos( ex.theta() );
double sinPsi = std::sin( ex.psi() ) , cosPsi = std::cos( ex.psi() );
array[0] = cosPsi * cosPhi - sinPsi * cosTheta * sinPhi;
array[1] = cosPsi * sinPhi + sinPsi * cosTheta * cosPhi;
......
......@@ -188,7 +188,7 @@ HepLorentzRotation & HepLorentzRotation::setRows
// Set based on using those rows as columns:
set (rrow1, rrow2, rrow3, rrow4);
// Now transpose in place:
register double q1, q2, q3;
double q1, q2, q3;
q1 = mxy; q2 = mxz; q3 = mxt;
mxy = myx; mxz = mzx; mxt = mtx;
myx = q1; mzx = q2; mtx = q3;
......
......@@ -56,9 +56,9 @@ double & HepLorentzVector::operator () (int i) {
HepLorentzVector & HepLorentzVector::boost
(double bx, double by, double bz){
double b2 = bx*bx + by*by + bz*bz;
register double ggamma = 1.0 / std::sqrt(1.0 - b2);
register double bp = bx*x() + by*y() + bz*z();
register double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
double ggamma = 1.0 / std::sqrt(1.0 - b2);
double bp = bx*x() + by*y() + bz*z();
double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
setX(x() + gamma2*bp*bx + ggamma*bx*t());
setY(y() + gamma2*bp*by + ggamma*by*t());
......@@ -190,13 +190,13 @@ Hep3Vector HepLorentzVector::boostVector() const {
HepLorentzVector & HepLorentzVector::boostX (double bbeta){
register double b2 = bbeta*bbeta;
double b2 = bbeta*bbeta;
if (b2 >= 1) {
ZMthrowA (ZMxpvTachyonic(
"boost along X with beta >= 1 (speed of light) -- no boost done"));
} else {
register double ggamma = std::sqrt(1./(1-b2));
register double tt = ee;
double ggamma = std::sqrt(1./(1-b2));
double tt = ee;
ee = ggamma*(ee + bbeta*pp.getX());
pp.setX(ggamma*(pp.getX() + bbeta*tt));
}
......@@ -204,13 +204,13 @@ HepLorentzVector & HepLorentzVector::boostX (double bbeta){
} /* boostX */
HepLorentzVector & HepLorentzVector::boostY (double bbeta){
register double b2 = bbeta*bbeta;
double b2 = bbeta*bbeta;
if (b2 >= 1) {
ZMthrowA (ZMxpvTachyonic(
"boost along Y with beta >= 1 (speed of light) -- \nno boost done"));
} else {
register double ggamma = std::sqrt(1./(1-b2));
register double tt = ee;
double ggamma = std::sqrt(1./(1-b2));
double tt = ee;
ee = ggamma*(ee + bbeta*pp.getY());
pp.setY(ggamma*(pp.getY() + bbeta*tt));
}
......@@ -218,13 +218,13 @@ HepLorentzVector & HepLorentzVector::boostY (double bbeta){
} /* boostY */
HepLorentzVector & HepLorentzVector::boostZ (double bbeta){
register double b2 = bbeta*bbeta;
double b2 = bbeta*bbeta;
if (b2 >= 1) {
ZMthrowA (ZMxpvTachyonic(
"boost along Z with beta >= 1 (speed of light) -- \nno boost done"));
} else {
register double ggamma = std::sqrt(1./(1-b2));
register double tt = ee;
double ggamma = std::sqrt(1./(1-b2));
double tt = ee;
ee = ggamma*(ee + bbeta*pp.getZ());
pp.setZ(ggamma*(pp.getZ() + bbeta*tt));
}
......
......@@ -66,9 +66,9 @@ HepLorentzVector & HepLorentzVector::boost
"no boost done"));
} else {
Hep3Vector u = aaxis.unit();
register double ggamma = std::sqrt(1./(1.-b2));
register double betaDotV = u.dot(pp)*bbeta;
register double tt = ee;
double ggamma = std::sqrt(1./(1.-b2));
double betaDotV = u.dot(pp)*bbeta;
double tt = ee;
ee = ggamma * (tt + betaDotV);
pp += ( ((ggamma-1)/b2)*betaDotV*bbeta + ggamma*bbeta*tt ) * u;
......
......@@ -116,14 +116,14 @@ bool HepLorentzVector::isNearCM
double b2 = vTotal2*tRecip*tRecip;
register double ggamma = std::sqrt(1./(1.-b2));
register double boostDotV1 = bboost.dot(pp);
register double gm1_b2 = (ggamma-1)/b2;
double ggamma = std::sqrt(1./(1.-b2));
double boostDotV1 = bboost.dot(pp);
double gm1_b2 = (ggamma-1)/b2;
HepLorentzVector w1 ( pp + ((gm1_b2)*boostDotV1+ggamma*ee) * bboost,
ggamma * (ee + boostDotV1) );
register double boostDotV2 = bboost.dot(w.pp);
double boostDotV2 = bboost.dot(w.pp);
HepLorentzVector w2 ( w.pp + ((gm1_b2)*boostDotV2+ggamma*w.ee) * bboost,
ggamma * (w.ee + boostDotV2) );
......@@ -171,14 +171,14 @@ double HepLorentzVector::howNearCM(const HepLorentzVector & w) const {
ZMthrowC ( ZMxpvTachyonic (
"boost vector in howNearCM appears to be tachyonic"));
}
register double ggamma = std::sqrt(1./(1.-b2));
register double boostDotV1 = bboost.dot(pp);
register double gm1_b2 = (ggamma-1)/b2;
double ggamma = std::sqrt(1./(1.-b2));
double boostDotV1 = bboost.dot(pp);
double gm1_b2 = (ggamma-1)/b2;
HepLorentzVector w1 ( pp + ((gm1_b2)*boostDotV1+ggamma*ee) * bboost,
ggamma * (ee + boostDotV1) );
register double boostDotV2 = bboost.dot(w.pp);
double boostDotV2 = bboost.dot(w.pp);
HepLorentzVector w2 ( w.pp + ((gm1_b2)*boostDotV2+ggamma*w.ee) * bboost,
ggamma * (w.ee + boostDotV2) );
......
......@@ -122,7 +122,7 @@ double HepLorentzVector::gamma() const {
//-***************
double HepLorentzVector::rapidity() const {
register double z1 = pp.getZ();
double z1 = pp.getZ();
if (std::fabs(ee) == std::fabs(z1)) {
ZMthrowA (ZMxpvInfinity(
"rapidity for 4-vector with |E| = |Pz| -- infinite result"));
......@@ -139,13 +139,13 @@ double HepLorentzVector::rapidity() const {
} /* rapidity */
double HepLorentzVector::rapidity(const Hep3Vector & ref) const {
register double r = ref.mag2();
double r = ref.mag2();
if (r == 0) {
ZMthrowA (ZMxpvZeroVector(
"A zero vector used as reference to LorentzVector rapidity"));
return 0;
}
register double vdotu = pp.dot(ref)/std::sqrt(r);
double vdotu = pp.dot(ref)/std::sqrt(r);
if (std::fabs(ee) == std::fabs(vdotu)) {
ZMthrowA (ZMxpvInfinity(
"rapidity for 4-vector with |E| = |Pu| -- infinite result"));
......@@ -160,7 +160,7 @@ double HepLorentzVector::rapidity(const Hep3Vector & ref) const {
} /* rapidity(ref) */
double HepLorentzVector::coLinearRapidity() const {
register double v1 = pp.mag();
double v1 = pp.mag();
if (std::fabs(ee) == std::fabs(v1)) {
ZMthrowA (ZMxpvInfinity(
"co-Linear rapidity for 4-vector with |E| = |P| -- infinite result"));
......
......@@ -27,14 +27,14 @@ namespace CLHEP {
HepRotation & HepRotation::set( const Hep3Vector & aaxis, double ddelta ) {
register double sinDelta = std::sin(ddelta), cosDelta = std::cos(ddelta);
register double oneMinusCosDelta = 1.0 - cosDelta;
double sinDelta = std::sin(ddelta), cosDelta = std::cos(ddelta);
double oneMinusCosDelta = 1.0 - cosDelta;
Hep3Vector u = aaxis.unit();
register double uX = u.getX();
register double uY = u.getY();
register double uZ = u.getZ();
double uX = u.getX();
double uY = u.getY();
double uZ = u.getZ();
rxx = oneMinusCosDelta * uX * uX + cosDelta;
rxy = oneMinusCosDelta * uX * uY - sinDelta * uZ;
......
......@@ -36,9 +36,9 @@ static inline double safe_acos (double x) {
HepRotation & HepRotation::set(double phi1, double theta1, double psi1) {
register double sinPhi = std::sin( phi1 ), cosPhi = std::cos( phi1 );
register double sinTheta = std::sin( theta1 ), cosTheta = std::cos( theta1 );
register double sinPsi = std::sin( psi1 ), cosPsi = std::cos( psi1 );
double sinPhi = std::sin( phi1 ), cosPhi = std::cos( phi1 );
double sinTheta = std::sin( theta1 ), cosTheta = std::cos( theta1 );