13 #ifndef ROOT_Math_LCGEngine 14 #define ROOT_Math_LCGEngine 22 virtual double Rndm() = 0;
45 void SetSeed(uint32_t seed) { fSeed = seed; }
51 inline double operator() () {
return Rndm_impl(); }
54 fSeed = (1103515245 * fSeed + 12345) & 0x7fffffffUL;
59 static unsigned int MinInt() {
return 0; }
61 static unsigned int MaxInt() {
return 0xffffffff; }
63 static int Size() {
return 1; }
65 static std::string
Name() {
return "LCGEngine"; }
68 void SetState(
const std::vector<uint32_t> & state) {
69 assert(!state.empty());
81 const double kCONS = 4.6566128730774E-10;
82 unsigned int rndm = IntRndm();
83 if (rndm != 0)
return kCONS*rndm;
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
void GetState(std::vector< uint32_t > &state)
void SetSeed(uint32_t seed)
void SetState(const std::vector< uint32_t > &state)
static int Size()
Size of the generator state.
static unsigned int MaxInt()
maximum integer taht can be generated
static unsigned int MinInt()
minimum integer taht can be generated
Namespace for new Math classes and functions.
static std::string Name()
Name of the generator.