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."
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>
Result_t IntRndm()
generate a 64 bit integer number
void GetState(std::vector< StateInt_t > &state) const
get the state of the generator
void SetSeed(Result_t seed)
set the generator seed
int Counter() const
Get the counter (between 0 and Size-1)
MixMaxEngine(uint64_t seed=1)
double Rndm_impl()
implementation function to generate the random number
static const char * Name()
get name of the generator
void RndmArray(int n, double *array)
generate an array of random numbers
void SetState(const std::vector< StateInt_t > &state)
set the full initial generator state
static int Size()
Get the size of the generator.
static uint64_t MaxInt()
maximum integer that can be generated. For MIXMAX is 2^61-1
static uint64_t MinInt()
minimum integer that can be generated. For MIXMAX is 0
Namespace for new Math classes and functions.
std::string ToString(const T &val)
Utility function for conversion to strings.
Namespace for new ROOT classes and functions.
RooArgSet S(const RooAbsArg &v1)
static void Apply(Engine *, int, int)
static void Apply(Engine *rng, int counter, int n)