ROOT
6.06/09
Reference Guide
|
MIXMAX Random number generator.
It is a matrix-recursive random number generator introduced by G. Savvidy in N.Z.Akopov, G.K.Savvidy and N.G.Ter-Arutyunian, Matrix Generator of Pseudorandom Numbers, J.Comput.Phys. 97, 573 (1991) DOI Link90016-E). This is a new very fast impelmentation by K. Savvidy by K. Savvidy and described in this paper, K. Savvidy, The MIXMAX Random Number Generator, Comp. Phys. Communic. (2015) DOI link
The period of the generator is 10^4682 for N=256, and 10^1597 for N=88
This implementation is only a wrapper around the real implemention, see mixmax.cxx and mixmax.h The generator, in C code, is available also at hepforge: http://mixmax.hepforge.org
Definition at line 55 of file MixMaxEngine.h.
Public Types | |
typedef TRandomEngine | BaseType |
typedef unsigned long long int | StateInt_t |
Public Member Functions | |
MixMaxEngine (uint64_t seed=1) | |
virtual | ~MixMaxEngine () |
void | GetState (std::vector< StateInt_t > &state) const |
get the state of the generator More... | |
int | Counter () const |
Get the counter (between 0 and Size-1) More... | |
void | SetSeed (unsigned int seed) |
set the generator seed More... | |
void | SetSeed64 (uint64_t seed) |
set the generator seed using a 64 bits integer More... | |
void | SetState (const std::vector< StateInt_t > &state, bool warmup=true) |
set the full initial generator state and warm up generator by doing some iterations More... | |
void | SetCounter (int val) |
set the counter More... | |
virtual double | Rndm () |
double | operator() () |
generate a double random number (faster interface) More... | |
void | RndmArray (int n, double *array) |
generate an array of random numbers More... | |
uint64_t | IntRndm () |
generate a 64 bit integer number More... | |
Public Member Functions inherited from ROOT::Math::TRandomEngine | |
virtual | ~TRandomEngine () |
Public Member Functions inherited from ROOT::Math::RandomBaseEngine | |
virtual | ~RandomBaseEngine () |
Static Public Member Functions | |
static int | Size () |
Get the size of the generator. More... | |
static uint64_t | MaxInt () |
maximum integer that can be generated. For MIXMAX is 2^61-1 More... | |
static void | SetSkipNumber (int nskip) |
set the number we want to use to skip generation higher value means higher luxury but slower More... | |
static void | SetFirstReturnElement (int index) |
set initial number to be used in the vector. More... | |
Private Member Functions | |
double | Rndm_impl () |
implementation function to generrate the random number More... | |
Private Attributes | |
rng_state_t * | fRngState |
#include <Math/MixMaxEngine.h>
Definition at line 60 of file MixMaxEngine.h.
typedef unsigned long long int ROOT::Math::MixMaxEngine::StateInt_t |
Definition at line 63 of file MixMaxEngine.h.
ROOT::Math::MixMaxEngine::MixMaxEngine | ( | uint64_t | seed = 1 | ) |
Definition at line 25 of file MixMaxEngine.cxx.
|
virtual |
Definition at line 30 of file MixMaxEngine.cxx.
int ROOT::Math::MixMaxEngine::Counter | ( | ) | const |
Get the counter (between 0 and Size-1)
Definition at line 97 of file MixMaxEngine.cxx.
void ROOT::Math::MixMaxEngine::GetState | ( | std::vector< StateInt_t > & | state | ) | const |
get the state of the generator
Definition at line 86 of file MixMaxEngine.cxx.
uint64_t ROOT::Math::MixMaxEngine::IntRndm | ( | ) |
generate a 64 bit integer number
Definition at line 70 of file MixMaxEngine.cxx.
|
inlinestatic |
maximum integer that can be generated. For MIXMAX is 2^61-1
Definition at line 81 of file MixMaxEngine.h.
|
inline |
generate a double random number (faster interface)
Definition at line 103 of file MixMaxEngine.h.
|
inlinevirtual |
Implements ROOT::Math::RandomBaseEngine.
Definition at line 100 of file MixMaxEngine.h.
|
private |
implementation function to generrate the random number
Definition at line 65 of file MixMaxEngine.cxx.
Referenced by operator()(), and Rndm().
generate an array of random numbers
Definition at line 75 of file MixMaxEngine.cxx.
void ROOT::Math::MixMaxEngine::SetCounter | ( | int | val | ) |
set the counter
Definition at line 101 of file MixMaxEngine.cxx.
|
static |
set initial number to be used in the vector.
set initial number to be used in the vector (the previous elements are skipped and not returned)
The previous elements are skipped and not returned.
Definition at line 45 of file MixMaxEngine.cxx.
Referenced by testMathRandom().
void ROOT::Math::MixMaxEngine::SetSeed | ( | unsigned int | seed | ) |
set the generator seed
Definition at line 50 of file MixMaxEngine.cxx.
void ROOT::Math::MixMaxEngine::SetSeed64 | ( | uint64_t | seed | ) |
set the generator seed using a 64 bits integer
Definition at line 55 of file MixMaxEngine.cxx.
Referenced by MixMaxEngine().
|
static |
set the number we want to use to skip generation higher value means higher luxury but slower
set decimation number
Definition at line 40 of file MixMaxEngine.cxx.
Referenced by testMathRandom().
void ROOT::Math::MixMaxEngine::SetState | ( | const std::vector< StateInt_t > & | state, |
bool | warmup = true |
||
) |
set the full initial generator state and warm up generator by doing some iterations
Definition at line 80 of file MixMaxEngine.cxx.
|
static |
Get the size of the generator.
Definition at line 93 of file MixMaxEngine.cxx.
|
private |
Definition at line 125 of file MixMaxEngine.h.
Referenced by Counter(), GetState(), IntRndm(), MixMaxEngine(), Rndm_impl(), RndmArray(), SetCounter(), SetSeed(), SetSeed64(), SetState(), and ~MixMaxEngine().