Import Geant4 10.5.0.beta source tree
This commit is contained in:
Vendored
+22
@@ -17,6 +17,28 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
24 May 2018 - G.Cosmo
|
||||
- Fixed compilation warnings from gcc-8.1.0 when using -Woverloaded-virtual
|
||||
compilation option (default in Geant4).
|
||||
|
||||
16 March 2018 - G.Cosmo
|
||||
- Synchronised with CLHEP-2.4.0.4.
|
||||
|
||||
07 March 2018 - G.Cosmo
|
||||
- Removed kludge for Windows introduced in tag "clhep-V10-04-00" to
|
||||
MinMaxRng.hh.
|
||||
- Further simplified setup for thread-local storage and atomics, as
|
||||
now all supported by c++11 in either clang or VC++.
|
||||
|
||||
06 March 2018 - G.Cosmo
|
||||
- Enabled thread-local storage and atomics on Windows; added flag in
|
||||
thread_local.h, use_atomic.h and atomic_in.h.
|
||||
|
||||
19 February 2018 - J.Madsen (clhep-V10-04-00)
|
||||
- Fixed Windows MT data race in MinMaxRng.hh.
|
||||
- Fixed warning C4293: '>>': shift count negative or too big, undefined behavior
|
||||
in Ranlux64Engine on Windows
|
||||
|
||||
11 December 2017 - G.Cosmo
|
||||
- MixMaxRng: fixed guard for assembly code in modadd() to protect
|
||||
builds on 32-bit systems.
|
||||
|
||||
+2
-1
@@ -84,7 +84,8 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the current engine status on the screen.
|
||||
|
||||
operator float(); // flat value, without worrying about filling bits
|
||||
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
|
||||
|
||||
virtual std::ostream & put (std::ostream & os) const;
|
||||
|
||||
@@ -76,6 +76,10 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the engine status on the screen.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the current engine status on the screen.
|
||||
|
||||
operator float(); // returns flat, without worrying about filling bits
|
||||
operator double(); // Returns same as flat()
|
||||
operator float(); // returns flat, without worrying about filling bits
|
||||
operator unsigned int(); // 32-bit flat, quickest of all
|
||||
|
||||
virtual std::ostream & put (std::ostream & os) const;
|
||||
|
||||
+5
-1
@@ -90,6 +90,10 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the engine status on the screen.
|
||||
|
||||
operator double();
|
||||
// Returns same as flat()
|
||||
operator float();
|
||||
// less precise flat, faster if possible
|
||||
operator unsigned int();
|
||||
// 32-bit flat
|
||||
|
||||
@@ -178,7 +182,7 @@ private:
|
||||
typedef struct rng_state_st rng_state_t; // struct alias
|
||||
rng_state_t S;
|
||||
};
|
||||
|
||||
|
||||
} // namespace CLHEP
|
||||
|
||||
#endif
|
||||
|
||||
@@ -84,6 +84,10 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the engine status on the screen.
|
||||
|
||||
operator double();
|
||||
// Returns same as flat()
|
||||
operator float();
|
||||
// less precise flat, faster if possible
|
||||
operator unsigned int();
|
||||
// 32-bit int flat, faster in this case
|
||||
|
||||
|
||||
@@ -91,6 +91,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;
|
||||
|
||||
+12
-11
@@ -83,20 +83,21 @@ public:
|
||||
void showStatus() const;
|
||||
// Dumps the engine status on the screen
|
||||
|
||||
operator float(); // flat value, without worrying about filling bits
|
||||
operator unsigned int(); // 32-bit flat value, quickest of all
|
||||
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
|
||||
|
||||
virtual std::ostream & put (std::ostream & os) const;
|
||||
virtual std::istream & get (std::istream & is);
|
||||
static std::string beginTag ( );
|
||||
virtual std::istream & getState ( std::istream & is );
|
||||
virtual std::ostream & put (std::ostream & os) const;
|
||||
virtual std::istream & get (std::istream & is);
|
||||
static std::string beginTag ( );
|
||||
virtual std::istream & getState ( std::istream & is );
|
||||
|
||||
std::string name() const;
|
||||
static std::string engineName() {return "RanshiEngine";}
|
||||
std::string name() const;
|
||||
static std::string engineName() {return "RanshiEngine";}
|
||||
|
||||
std::vector<unsigned long> put () const;
|
||||
bool get (const std::vector<unsigned long> & v);
|
||||
bool getState (const std::vector<unsigned long> & v);
|
||||
std::vector<unsigned long> put () const;
|
||||
bool get (const std::vector<unsigned long> & v);
|
||||
bool getState (const std::vector<unsigned long> & v);
|
||||
|
||||
private:
|
||||
enum {numBuff = 512};
|
||||
|
||||
@@ -7,18 +7,11 @@
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#if (defined (G4MULTITHREADED))
|
||||
#if defined (G4MULTITHREADED)
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
|
||||
#include <atomic>
|
||||
#define CLHEP_ATOMIC_INT_TYPE std::atomic<int>
|
||||
#elif __clang__
|
||||
#if __has_feature(c_atomic)
|
||||
#include <atomic>
|
||||
#define CLHEP_ATOMIC_INT_TYPE std::atomic<int>
|
||||
#else
|
||||
#define CLHEP_ATOMIC_INT_TYPE int
|
||||
#endif
|
||||
#else
|
||||
#define CLHEP_ATOMIC_INT_TYPE int
|
||||
#endif
|
||||
|
||||
@@ -7,16 +7,10 @@
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#if (defined (G4MULTITHREADED) && defined (G4USE_STD11))
|
||||
#if defined (G4MULTITHREADED)
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
|
||||
#define CLHEP_THREAD_LOCAL thread_local
|
||||
#elif __clang__
|
||||
#if __has_feature(cxx_thread_local)
|
||||
#define CLHEP_THREAD_LOCAL thread_local
|
||||
#else
|
||||
#define CLHEP_THREAD_LOCAL
|
||||
#endif
|
||||
#else
|
||||
#define CLHEP_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
+2
-11
@@ -7,22 +7,13 @@
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#if (defined (G4MULTITHREADED))
|
||||
#if defined (G4MULTITHREADED)
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
|
||||
#include <atomic>
|
||||
#define CLHEP_USE_ATOMIC
|
||||
#elif __clang__
|
||||
#if __has_feature(c_atomic)
|
||||
#include <atomic>
|
||||
#define CLHEP_USE_ATOMIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
-4
@@ -31,10 +31,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;
|
||||
|
||||
+4
@@ -193,6 +193,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() );
|
||||
|
||||
+8
@@ -268,6 +268,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);
|
||||
|
||||
+4
@@ -230,6 +230,10 @@ void MTwistEngine::showStatus() const
|
||||
std::cout << "----------------------------------------" << std::endl;
|
||||
}
|
||||
|
||||
MTwistEngine::operator double() {
|
||||
return flat();
|
||||
}
|
||||
|
||||
MTwistEngine::operator float() {
|
||||
unsigned int y;
|
||||
|
||||
|
||||
+10
@@ -338,6 +338,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());
|
||||
|
||||
+8
@@ -243,6 +243,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];
|
||||
|
||||
+3
-3
@@ -422,10 +422,10 @@ void Ranlux64Engine::setSeed(long seed, int lux) {
|
||||
}
|
||||
// are we on a 64bit machine?
|
||||
if( sizeof(long) >= 8 ) {
|
||||
long topbits1, topbits2;
|
||||
int64_t topbits1, topbits2;
|
||||
#ifdef WIN32
|
||||
topbits1 = ( seed >> 32) & 0xffff ;
|
||||
topbits2 = ( seed >> 48) & 0xffff ;
|
||||
topbits1 = ( (int64_t) seed >> 32) & 0xffff ;
|
||||
topbits2 = ( (int64_t) seed >> 48) & 0xffff ;
|
||||
#else
|
||||
topbits1 = detail::rshift<32>(seed) & 0xffff ;
|
||||
topbits2 = detail::rshift<48>(seed) & 0xffff ;
|
||||
|
||||
+8
@@ -411,6 +411,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);
|
||||
|
||||
+4
@@ -217,6 +217,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;
|
||||
|
||||
Reference in New Issue
Block a user