Random Number Generators.
More...
|
void | random_lib_lp_init (lp_id_t lp_id, struct rng_ctx *rng_ctx) |
| Initialize the rollbackable RNG library of the current LP.
|
|
uint64_t | RandomU64 (void) |
| Return a random 64-bit value. More...
|
|
double | Random (void) |
| Return a random value in [0,1] according to a uniform distribution. More...
|
|
double | Normal (void) |
| Return a pair of independent random numbers according to a Standard Normal Distribution. More...
|
|
int | RandomRange (int min, int max) |
|
int | RandomRangeNonUniform (int x, int min, int max) |
|
double | Gamma (unsigned ia) |
| Return a number in according to a Gamma Distribution of Integer Order ia Corresponds to the waiting time to the ia-th event in a Poisson process of unit mean. More...
|
|
double | Poisson (void) |
| Return a random number according to an Exponential distribution with unit mean Corresponds to the waiting time to the next event in a Poisson process of unit mean. More...
|
|
unsigned | Zipf (double skew, unsigned limit) |
| Return a random sample from a Zipf distribution Based on the rejection method by Luc Devroye for sampling: "Non-Uniform Random Variate Generation, page 550, Springer-Verlag, 1986. More...
|
|
|
static const uint32_t | xxtea_seeding_key [4] |
|
Random Number Generators.
Piece-Wise Deterministic Random Number Generators.
- Copyright
- Copyright (C) 2008-2022 HPDCS Group https://hpdcs.github.io
◆ Gamma()
double Gamma |
( |
unsigned |
ia | ) |
|
Return a number in according to a Gamma Distribution of Integer Order ia Corresponds to the waiting time to the ia-th event in a Poisson process of unit mean.
- Author
- D. E. Knuth
- Parameters
-
ia | Integer Order of the Gamma Distribution |
- Returns
- A random number
◆ Normal()
Return a pair of independent random numbers according to a Standard Normal Distribution.
- Returns
- A pair of random numbers
◆ Poisson()
Return a random number according to an Exponential distribution with unit mean Corresponds to the waiting time to the next event in a Poisson process of unit mean.
- Returns
- A random number
◆ Random()
Return a random value in [0,1] according to a uniform distribution.
- Returns
- The random number
◆ RandomU64()
uint64_t RandomU64 |
( |
void |
| ) |
|
Return a random 64-bit value.
- Returns
- The random number
◆ Zipf()
unsigned Zipf |
( |
double |
skew, |
|
|
unsigned |
limit |
|
) |
| |
Return a random sample from a Zipf distribution Based on the rejection method by Luc Devroye for sampling: "Non-Uniform Random Variate Generation, page 550, Springer-Verlag, 1986.
- Parameters
-
skew | The skew of the distribution |
limit | The largest sample to retrieve |
- Returns
- A random number
◆ xxtea_seeding_key
const uint32_t xxtea_seeding_key[4] |
|
static |
Initial value:= {UINT32_C(0xd0a8f58a), UINT32_C(0x33359424), UINT32_C(0x09baa55b),
UINT32_C(0x80e1bdb0)}