|
ATLAS Offline Software
|
Go to the documentation of this file.
19 #ifndef TESTTOOLS_RANDOM_H
20 #define TESTTOOLS_RANDOM_H
24 #ifdef ATLAS_GCC_CHECKERS
25 #define ATLAS_NOT_REENTRANT [[ATLAS::not_reentrant]]
27 #define ATLAS_NOT_REENTRANT
46 seed = (1664525*seed + 1013904223);
55 return static_cast<float>(
rng_seed(seed)) /
static_cast<float>(rngmax) * (rmax-rmin) + rmin;
63 return static_cast<int> (
randf_seed (seed, rmax, rmin));
126 T fac = sqrt(-2*
log(r2) / r2);
127 return v1*fac*m_s + m_mu;
150 #endif // not TESTTOOLS_RANDOM_H
int randi_seed(uint32_t &seed, int rmax, int rmin=0)
Generate an integer random number between rmin and rmax.
normal_distribution(T mu, T s)
URNG(uint32_t the_seed=1)
T operator()(URNG &rng) const
static constexpr result_type max()
double randf(double rmax, double rmin=0)
functions & macros to test the difference between floats
static constexpr result_type min()
uint32_t rng ATLAS_NOT_REENTRANT()
Generator compatible with the C++11 STL UniformRandomNumberGenerator.
Generator compatible with the STL RandomNumberGenerator.
uint32_t rng_seed(uint32_t &seed)
Generate a random number between 0 and rngmax.
float randf_seed(uint32_t &seed, float rmax, float rmin=0)
Generate a floating-point random number between rmin and rmax.