ConicBundle
|
device independent random number generator based on long int with seed More...
#include <gb_rand.hxx>
Public Member Functions | |
void | init (long seed=1) |
restart generator with seed | |
GB_rand (long seed=1) | |
calls init(seed) | |
long | unif_long (long m) |
returns a random integer number "uniformly distributed" in {0,..,m-1} | |
double | next () |
returns a random double number "uniformly distributed" in (0,1) | |
std::ostream & | save (std::ostream &out) const |
save current configuration to out so as to continue identically after restore | |
std::istream & | restore (std::istream &in) |
restore settings as stored in save | |
Private Member Functions | |
long | mod_diff (long x, long y) |
compute (x-y) & 0x7fffffff | |
long | flip_cycle () |
compute next set of numbers | |
Private Attributes | |
long | A [56] |
storage for the next few precomputed random numbers | |
int | ind |
index of the next number to return | |
device independent random number generator based on long int with seed