MixMaxEngine is a wrapper class for the MIXMAX Random number generator.
MIXMAX is a matrix-recursive random number generator introduced by G. Savvidy.
The real implementation of the generator, written in C, is in the mixmax.h and mixmax.cxx files. This generator code is available also at hepforge: http://mixmax.hepforge.org The MIXMAX code has been created and developed by Konstantin Savvidy and it is released under GNU Lesser General Public License v3.
This wrapper class provides 3 different variants of MIXMAX according to the template para extra parameter N. The extra parameter, SkipNumber
, is used to perform additional iterations of the generator before returning the random numbers. For example, when SkipNumber = 2
, the generator will have two extra iterations that will be discarder.
SkipNumber=0
) \(10^{4682}\). For this generator we recommend in ROOT using a default value of `SkipNumber=2, while for the previous two generators skipping is not needed.This table describes the properties of the MIXMAX generators. MIXMAX is a genuine 61 bit generator on the Galois field GF[p], where \(p=2^{61}-1\) is the Mersenne prime number. The MIXMAX generators with these parameters pass all of the BigCrush tests in the TestU01 suite
Dimension | Entropy | Decorrelation Time | Iteration Time | Relaxation Time | Period q |
---|---|---|---|---|---|
N | \(~h(T)\) | \(\tau_0 = {1\over h(T) 2N }\) | t | \(\tau ={1\over h(T) \ln {1\over \delta v_0}}\) | \(\log_{10} (q)\) |
256 | 194 | 0.000012 | 1 | 95.00 | 4682 (full period is not confirmed) |
8 | 220 | 0.00028 | 1 | 1.54 | 129 |
17 | 374 | 0.000079 | 1 | 1.92 | 294 |
240 | 8679 | 0.00000024 | 1 | 1.17 | 4389 |
The entropy \(h(T)\), decorrelation time \(\tau_0\) decorrelation time, relaxation time \(\tau\) and period of the MIXMAX generator, expressed in units of the iteration time \(t\), which is normalised to 1. Clearly \(\tau_0~ < t ~< \tau\).
Definition at line 102 of file MixMaxEngine.h.
Public Types | |
typedef TRandomEngine | BaseType |
typedef uint64_t | Result_t |
typedef uint64_t | StateInt_t |
Public Member Functions | |
MixMaxEngine (uint64_t seed=1) | |
~MixMaxEngine () override | |
Result_t | IntRndm () |
generate a 64 bit integer number | |
double | operator() () |
generate a double random number (faster interface) | |
double | Rndm () override |
void | RndmArray (int n, double *array) |
generate an array of random numbers | |
void | SetSeed (Result_t seed) |
set the generator seed | |
Public Member Functions inherited from ROOT::Math::TRandomEngine | |
virtual | ~TRandomEngine () |
Static Public Member Functions | |
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 | |
static const char * | Name () |
get name of the generator | |
static int | Size () |
Get the size of the generator. | |
Protected Member Functions | |
int | Counter () const |
Get the counter (between 0 and Size-1) | |
void | GetState (std::vector< StateInt_t > &state) const |
get the state of the generator | |
void | SetState (const std::vector< StateInt_t > &state) |
set the full initial generator state | |
Private Member Functions | |
double | Rndm_impl () |
implementation function to generate the random number | |
Private Attributes | |
MixMaxEngineImpl< N > * | fRng |
mixmax internal engine class | |
#include <Math/MixMaxEngine.h>
typedef TRandomEngine ROOT::Math::MixMaxEngine< N, SkipNumber >::BaseType |
Definition at line 106 of file MixMaxEngine.h.
typedef uint64_t ROOT::Math::MixMaxEngine< N, SkipNumber >::Result_t |
Definition at line 114 of file MixMaxEngine.h.
typedef uint64_t ROOT::Math::MixMaxEngine< N, SkipNumber >::StateInt_t |
Definition at line 110 of file MixMaxEngine.h.
ROOT::Math::MixMaxEngine< N, S >::MixMaxEngine | ( | uint64_t | seed = 1 | ) |
Definition at line 35 of file MixMaxEngine.icc.
|
override |
Definition at line 42 of file MixMaxEngine.icc.
|
protected |
Get the counter (between 0 and Size-1)
Definition at line 152 of file MixMaxEngine.icc.
|
protected |
get the state of the generator
Definition at line 141 of file MixMaxEngine.icc.
uint64_t ROOT::Math::MixMaxEngine< N, S >::IntRndm |
generate a 64 bit integer number
Definition at line 103 of file MixMaxEngine.icc.
|
static |
maximum integer that can be generated. For MIXMAX is 2^61-1
Definition at line 111 of file MixMaxEngine.icc.
|
static |
minimum integer that can be generated. For MIXMAX is 0
Definition at line 117 of file MixMaxEngine.icc.
|
static |
get name of the generator
Definition at line 157 of file MixMaxEngine.icc.
|
inline |
generate a double random number (faster interface)
Definition at line 138 of file MixMaxEngine.h.
|
inlineoverridevirtual |
Implements ROOT::Math::TRandomEngine.
Definition at line 135 of file MixMaxEngine.h.
|
private |
implementation function to generate the random number
Definition at line 92 of file MixMaxEngine.icc.
generate an array of random numbers
Definition at line 123 of file MixMaxEngine.icc.
void ROOT::Math::MixMaxEngine< N, S >::SetSeed | ( | Result_t | seed | ) |
set the generator seed
Definition at line 53 of file MixMaxEngine.icc.
|
protected |
set the full initial generator state
Definition at line 130 of file MixMaxEngine.icc.
|
static |
Get the size of the generator.
Definition at line 147 of file MixMaxEngine.icc.
|
private |
mixmax internal engine class
Definition at line 170 of file MixMaxEngine.h.