17 #ifndef ROOT_Math_MixMaxEngine_icc 18 #define ROOT_Math_MixMaxEngine_icc 20 #ifndef ROOT_Math_MixMaxEngine 21 #error "Do not use MixMaxEngine.icc directly. #include \"MixMaxEngine.h\" instead." 22 #endif // ROOT_Math_MixMaxEngine 34 template<
int N,
int S>
41 template<
int N,
int S>
43 if (fRng)
delete fRng;
52 template<
int N,
int S>
72 template<
int SkipNumber>
74 template<
class Engine>
75 static void Apply (Engine * rng,
int counter,
int n) {
77 if (counter < n)
return;
78 for (
int iskip = 0; iskip < SkipNumber; ++iskip)
85 template<
class Engine>
86 static void Apply (Engine *,
int ,
int ) {
91 template<
int N,
int S>
93 int counter = fRng->Counter();
97 fRng->SetCounter(counter);
102 template<
int N,
int S>
104 int counter = fRng->Counter();
106 fRng->SetCounter(counter);
107 return fRng->IntRndm();
110 template<
int N,
int S>
113 return 2305843009213693951ULL;
116 template<
int N,
int S>
122 template<
int N,
int S>
125 for (
int i = 0; i < n; ++i)
126 array[i] = Rndm_impl();
129 template<
int N,
int S>
131 assert(state.size() >=
N);
136 fRng->SetState(state);
140 template<
int N,
int S>
143 fRng->GetState(state);
146 template<
int N,
int S>
151 template<
int N,
int S>
153 return fRng->Counter();
156 template<
int N,
int S>
158 std::string name =
"MixMax";
static uint64_t MaxInt()
maximum integer that can be generated. For MIXMAX is 2^61-1
static std::string Name()
get name of the generator
void SetState(const std::vector< StateInt_t > &state)
set the full initial generator state
Namespace for new ROOT classes and functions.
static uint64_t MinInt()
minimum integer that can be generated. For MIXMAX is 0
static void Apply(Engine *rng, int counter, int n)
static void Apply(Engine *, int, int)
MixMaxEngine(uint64_t seed=1)
double Rndm_impl()
implementation function to generate the random number
void SetSeed(Result_t seed)
set the generator seed
void RndmArray(int n, double *array)
generate an array of random numbers
int Counter() const
Get the counter (between 0 and Size-1)
static int Size()
Get the size of the generator.
Result_t IntRndm()
generate a 64 bit integer number
void GetState(std::vector< StateInt_t > &state) const
get the state of the generator
Namespace for new Math classes and functions.
std::string ToString(const T &val)
Utility function for conversion to strings.