17 #ifndef ROOT_Math_MixMaxEngine_icc 18 #define ROOT_Math_MixMaxEngine_icc 32 template<
int N,
int S>
39 template<
int N,
int S>
41 if (fRng)
delete fRng;
50 template<
int N,
int S>
70 template<
int SkipNumber>
72 template<
class Engine>
73 static void Apply (Engine * rng,
int counter,
int n) {
75 if (counter < n)
return;
76 for (
int iskip = 0; iskip < SkipNumber; ++iskip)
83 template<
class Engine>
84 static void Apply (Engine *,
int ,
int ) {
89 template<
int N,
int S>
91 int counter = fRng->Counter();
95 fRng->SetCounter(counter);
100 template<
int N,
int S>
102 int counter = fRng->Counter();
104 fRng->SetCounter(counter);
105 return fRng->IntRndm();
108 template<
int N,
int S>
111 return 2305843009213693951ULL;
114 template<
int N,
int S>
120 template<
int N,
int S>
123 for (
int i = 0; i <
n; ++i)
124 array[i] = Rndm_impl();
127 template<
int N,
int S>
129 assert(state.size() >=
N);
134 fRng->SetState(state);
138 template<
int N,
int S>
141 fRng->GetState(state);
144 template<
int N,
int S>
149 template<
int N,
int S>
151 return fRng->Counter();
154 template<
int N,
int S>
156 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
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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
RooArgSet S(const RooAbsArg &v1)
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.