NOMAD Source
Version 4.0.0 Beta
|
Brief Class for random number generator. More...
#include <RNG.hpp>
Static Public Member Functions | |
static int | getSeed () |
Get current seed. More... | |
static void | setSeed (int s) |
Set seed. More... | |
static uint32_t | rand () |
Get a random integer as uint32. More... | |
static double | rand (double a, double b) |
Get a random number having a normal distribution as double. More... | |
static double | normalRandMean0 (double Var=1, int Nsample=12) |
Get a random number using a normal distribution centered on 0. More... | |
static double | normalRand (double Mean=0, double Var=1) |
Get a random number approaching a normal distribution N(Mean,Var) as double. More... | |
static void | resetPrivateSeedToDefault () |
Reset seed to its default value. More... | |
static void | getPrivateSeed (uint32_t &x, uint32_t &y, uint32_t &z) |
Get private values. More... | |
static void | setPrivateSeed (uint32_t x, uint32_t y, uint32_t z) |
Reset seed to given values. More... | |
Static Private Attributes | |
static uint32_t | x_def |
static uint32_t | y_def |
static uint32_t | z_def |
Initial values for the random number generator. More... | |
static uint32_t | _x |
static uint32_t | _y |
static uint32_t | _z |
Current values for the random number generator. More... | |
static int | _s |
Brief Class for random number generator.
This class is used to set a seed for the random number generator and get a random integer or a random double between two values.
|
inlinestatic |
Get current seed.
|
static |
Get a random number approaching a normal distribution N(Mean,Var) as double.
/param Mean Mean of the target normal distribution – IN (Opt) (default = 0). /param Var Variance of the target normal distribution – IN (Opt) (default = 1). /return A random number.
|
static |
Get a random number using a normal distribution centered on 0.
Get a random number approaching a normal distribution (N(0,Var)) as double A series of Nsample random numbers Xi in the interval [-sqrt(3*Var);+sqrt(3*Var)] is used -> E[Xi] = 0, Var(Xi) = var see http://en.wikipedia.org/wiki/Central_limit_theorem
/param Var Variance of the target normal distribution – IN (Opt) (default =1). /param Nsample Number of samples for averaging – IN (Opt) (default = 12). /return A double in the interval [-sqrt(3*Var);+sqrt(3*Var)].
|
static |
Get a random integer as uint32.
This function serves to obtain a random number /return
An integer in the interval [0,UINT32_MAX].
|
inlinestatic |
|
inlinestatic |
Reset seed to its default value.
Definition at line 86 of file RNG.hpp.
|
static |
Set seed.
|
staticprivate |
|
staticprivate |