Commit fbebe1bd authored by Lynn Garren's avatar Lynn Garren
Browse files

Merge branch 'release/CLHEP_2_4_1_0'

parents 4a981ab7 e4507ac7
......@@ -92,6 +92,8 @@ public:
int getLuxury() const { return luxury; }
// Gets the luxury level.
operator double(); // Returns same as flat()
operator float(); // less precise flat, faster if possible
operator unsigned int(); // 32-bit flat, but slower than double or float
virtual std::ostream & put (std::ostream & os) const;
......
......@@ -84,6 +84,7 @@ public:
void showStatus() const;
// Dumps the engine status on the screen
operator double(); // Returns same as flat()
operator float(); // flat value, without worrying about filling bits
operator unsigned int(); // 32-bit flat value, quickest of all
......
......@@ -83,6 +83,7 @@ public:
void showStatus() const;
// Dumps the current engine status on the screen.
operator double(); // Returns same as flat()
operator float(); // flat value, without worrying about filling bits
operator unsigned int(); // 32-bit flat value, quickest of all
......
......@@ -23,10 +23,6 @@ void DoubConv::fill_byte_order () {
z *= 256;
}
// x, in IEEE format, would now be 0x4330060504030201
union DB8 {
unsigned char b[8];
double d;
};
DB8 xb;
xb.d = x;
int n;
......@@ -121,4 +117,4 @@ double DoubConv::longs2double (const std::vector<unsigned long> & v) {
return db.d;
}
} // end namespace HepMC
} // end namespace CLHEP
......@@ -216,6 +216,10 @@ void DualRand::showStatus() const {
std::cout.precision(pr);
}
DualRand::operator double() {
return flat();
}
DualRand::operator float() {
return (float) ( (integerCong ^ tausworthe) * twoToMinus_32()
+ nearlyTwoToMinus_54() );
......
......@@ -243,6 +243,10 @@ void Hurd160Engine::showStatus() const {
std::cout.precision(pr);
}
Hurd160Engine::operator double() {
return flat();
}
Hurd160Engine::operator float() {
if( wordIndex <= 1 ) { // MF 9/15/98: skip word 0
advance();
......
......@@ -263,6 +263,10 @@ void Hurd288Engine::showStatus() const {
std::cout << "-------------------------------------------" << std::endl;
}
Hurd288Engine::operator double() {
return flat();
}
Hurd288Engine::operator float() {
if( wordIndex <= 1 ) { // MF 9/15/98: skip word 0
advance();
......
......@@ -296,6 +296,14 @@ void HepJamesRandom::flatArray(const int size, double* vect)
}
}
HepJamesRandom::operator double() {
return flat();
}
HepJamesRandom::operator float() {
return float( flat() );
}
HepJamesRandom::operator unsigned int() {
return ((unsigned int)(flat() * exponent_bit_32()) & 0xffffffff ) |
(((unsigned int)( u[i97] * exponent_bit_32())>>16) & 0xff);
......
......@@ -231,6 +231,10 @@ void MTwistEngine::showStatus() const
std::cout << "----------------------------------------" << std::endl;
}
MTwistEngine::operator double() {
return flat();
}
MTwistEngine::operator float() {
unsigned int y;
......
......@@ -339,6 +339,16 @@ void MixMaxRng::flatArray(const int size, double* vect )
for (int i=0; i<size; ++i) { vect[i] = flat(); }
}
MixMaxRng::operator double()
{
return flat();
}
MixMaxRng::operator float()
{
return float( flat() );
}
MixMaxRng::operator unsigned int()
{
return static_cast<unsigned int>(get_next());
......
......@@ -365,6 +365,14 @@ void RandEngine::flatArray(const int size, double* vect)
vect[i]=flat();
}
RandEngine::operator double() {
return flat();
}
RandEngine::operator float() {
return float( flat() );
}
RandEngine::operator unsigned int() {
return RandEngineBuilder<RAND_MAX>::thirtyTwoRandomBits(seq);
}
......
......@@ -266,6 +266,14 @@ void RanecuEngine::flatArray(const int size, double* vect)
table[index][1] = seed2;
}
RanecuEngine::operator double() {
return flat();
}
RanecuEngine::operator float() {
return float( flat() );
}
RanecuEngine::operator unsigned int() {
const int index = seq;
long seed1 = table[index][0];
......
......@@ -474,6 +474,14 @@ void RanluxEngine::flatArray(const int size, double* vect)
}
}
RanluxEngine::operator double() {
return flat();
}
RanluxEngine::operator float() {
return float( flat() );
}
RanluxEngine::operator unsigned int() {
return ((unsigned int)(flat() * exponent_bit_32()) & 0xffffffff) |
(((unsigned int)(float_seed_table[i_lag]*exponent_bit_32())>>16) & 0xff);
......
......@@ -241,6 +241,10 @@ void RanshiEngine::showStatus() const {
std::cout << "-------------------------------------------" << std::endl;
}
RanshiEngine::operator double() {
return flat();
}
RanshiEngine::operator float() {
unsigned int redAngle = (((numBuff/2) - 1) & redSpin) + halfBuff;
unsigned int blkSpin = buffer[redAngle] & 0xffffffff;
......
......@@ -203,6 +203,10 @@ void TripleRand::showStatus() const {
<< std::endl;
}
TripleRand::operator double() {
return flat();
}
TripleRand::operator float() {
return (float)
( ( integerCong ^ tausworthe ^ (unsigned int)hurd ) * twoToMinus_32()
......
......@@ -53,7 +53,7 @@ int main() {
}
in.close();
} else throw std::runtime_error("File open error");
} catch(std::runtime_error e) {
} catch(std::runtime_error &e) {
std::ostringstream dStr;
dStr << "Error: " << e.what()
<< " processing seed from file \"" << "/dev/urandom" << "\".";
......
==============================
11.06.18 Release CLHEP-2.4.1.0
==============================
==============================
16.03.18 Release CLHEP-2.4.0.4
==============================
==============================
......
==============================
11.06.18 Release CLHEP-2.4.1.0
==============================
==============================
16.03.18 Release CLHEP-2.4.0.4
==============================
==============================
......
==============================
11.06.18 Release CLHEP-2.4.1.0
==============================
==============================
16.03.18 Release CLHEP-2.4.0.4
==============================
......
==============================
11.06.18 Release CLHEP-2.4.1.0
==============================
* src/RotationA.cc: fix a Wshadow problem introduced in 2.3.4.4
==============================
16.03.18 Release CLHEP-2.4.0.4
==============================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment