13 #ifndef ROOT_Math_LCGEngine 14 #define ROOT_Math_LCGEngine 23 virtual double Rndm() = 0;
46 void SetSeed(uint32_t seed) { fSeed = seed; }
52 inline double operator() () {
return Rndm_impl(); }
55 fSeed = (1103515245 * fSeed + 12345) & 0x7fffffffUL;
60 static unsigned int MinInt() {
return 0; }
62 static unsigned int MaxInt() {
return 0xffffffff; }
64 static int Size() {
return 1; }
66 static std::string
Name() {
return "LCGEngine"; }
69 void SetState(
const std::vector<uint32_t> & state) {
70 assert(!state.empty());
82 const double kCONS = 4.6566128730774E-10;
83 unsigned int rndm = IntRndm();
84 if (rndm != 0)
return kCONS*rndm;
Namespace for new ROOT classes and functions.
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.