SoPlex
|
#include <random.h>
Public Member Functions | |
Access | |
Real | next (Real minimum=0.0, Real maximum=1.0) |
returns next random number. | |
uint32_t | getSeed () const |
returns the initial seed shift | |
Modification | |
void | setSeed (uint32_t initshift) |
initialize all seeds of the random number generator. | |
Constructors / destructors | |
Random (uint32_t randomseed=0) | |
default constructor. | |
~Random () | |
destructor |
Private Member Functions | |
Helpers | |
Real | next_random () |
executes KISS random number generator and returns a pseudo random Real value in [0,1]. |
Private Attributes | |
Data | |
uint32_t | seedshift |
initial shift for random seeds. | |
uint32_t | lin_seed |
random seed for linear congruential RNS. | |
uint32_t | xor_seed |
random seed for XOR-shift RNS. | |
uint32_t | mwc_seed |
random seed Multiple-with-carry RNS. | |
uint32_t | cst_seed |
random seed shifted for mwc_seed. |
Random numbers.
Class Random provides random Real variables, i.e. a value variable that gives another value each time it is accessed. It may be used just like an ordinary Real by means of an overloaded cast operator Real()%.
This is an implementation of KISS random number generator developed by George Marsaglia. KISS is combination of three different random number generators:
KISS has a period of 2^123 and passes all statistical test part of BigCrush-Test of TestU01 [1].
|
explicit |
uint32_t getSeed | ( | ) | const |
|
private |
void setSeed | ( | uint32_t | initshift | ) |
initialize all seeds of the random number generator.
Definition at line 133 of file random.h.
References cst_seed, lin_seed, mwc_seed, next_random(), seedshift, SOPLEX_DEFAULT_CST, SOPLEX_DEFAULT_LIN, SOPLEX_DEFAULT_MWC, SOPLEX_DEFAULT_XOR, SOPLEX_MAX, and xor_seed.
Referenced by Random().
|
private |
random seed shifted for mwc_seed.
Definition at line 76 of file random.h.
Referenced by next_random(), and setSeed().
|
private |
random seed for linear congruential RNS.
Definition at line 73 of file random.h.
Referenced by next_random(), and setSeed().
|
private |
random seed Multiple-with-carry RNS.
Definition at line 75 of file random.h.
Referenced by next_random(), and setSeed().
|
private |
|
private |
random seed for XOR-shift RNS.
Definition at line 74 of file random.h.
Referenced by next_random(), and setSeed().