General purpose Random number generator algorithms.
More...
#include <random_algorithm.h>
|
| | Random ()=delete |
| |
| | Random (RandomBitGenerator &generator) |
| | Initialise a new instance of the Random class. More...
|
| |
| int | next_int () |
| | Generates the next random integer in the sequence. More...
|
| |
| int | next_int (const int &max_value) |
| | Generates the next random integer in sequence in range [min(), max_value) More...
|
| |
| int | next_int (const int &min_value, const int &max_value) |
| | Generates the next random integer in sequence in range [min_value, max_value) More...
|
| |
| double | next_double () noexcept |
| | Generates a random floating point number in range [0,1) More...
|
| |
| double | next_normal () |
| | Generates the next random number from a standard normal distribution. More...
|
| |
| double | next_normal (const double &mean, const double &standard_deviation) |
| | Generates the next random number from a normal distribution. More...
|
| |
| int | next_empirical_discrete (const std::vector< int > &values, const std::vector< float > &cdf) |
| | Samples a random value from an empirical distribution. More...
|
| |
| int | next_empirical_discrete (const std::vector< int > &values, const std::vector< double > &cdf) |
| | Samples a random value from an empirical distribution. More...
|
| |
General purpose Random number generator algorithms.
◆ Random() [1/2]
◆ Random() [2/2]
Initialise a new instance of the Random class.
- Parameters
-
| generator | Underline pseudo-random number engine instance |
◆ next_double()
| double hgps::Random::next_double |
( |
| ) |
|
|
noexcept |
Generates a random floating point number in range [0,1)
- Returns
- A floating point value in range [0,1).
◆ next_empirical_discrete() [1/2]
| int hgps::Random::next_empirical_discrete |
( |
const std::vector< int > & |
values, |
|
|
const std::vector< double > & |
cdf |
|
) |
| |
Samples a random value from an empirical distribution.
- Parameters
-
| values | The empirical distribution values |
| cdf | The cumulative distribution values |
- Returns
- The random select value
◆ next_empirical_discrete() [2/2]
| int hgps::Random::next_empirical_discrete |
( |
const std::vector< int > & |
values, |
|
|
const std::vector< float > & |
cdf |
|
) |
| |
Samples a random value from an empirical distribution.
- Parameters
-
| values | The empirical distribution values |
| cdf | The cumulative distribution values |
- Returns
- The random select value
◆ next_int() [1/3]
| int hgps::Random::next_int |
( |
| ) |
|
Generates the next random integer in the sequence.
- Returns
- A random integer value in range [
min(), max())
◆ next_int() [2/3]
| int hgps::Random::next_int |
( |
const int & |
max_value | ) |
|
Generates the next random integer in sequence in range [min(), max_value)
- Parameters
-
| max_value | The maximum value |
- Returns
- A random integer value in range [min(), max_value)
◆ next_int() [3/3]
| int hgps::Random::next_int |
( |
const int & |
min_value, |
|
|
const int & |
max_value |
|
) |
| |
Generates the next random integer in sequence in range [min_value, max_value)
- Parameters
-
| min_value | The minimum value |
| max_value | The maximum value |
- Returns
- A random integer value in range [min_value, max_value)
◆ next_normal() [1/2]
| double hgps::Random::next_normal |
( |
| ) |
|
Generates the next random number from a standard normal distribution.
- Returns
- The generated floating point random number
◆ next_normal() [2/2]
| double hgps::Random::next_normal |
( |
const double & |
mean, |
|
|
const double & |
standard_deviation |
|
) |
| |
Generates the next random number from a normal distribution.
- Parameters
-
| mean | The mean parameter |
| standard_deviation | The standard deviation parameter |
- Returns
- The generated floating point random number
The documentation for this class was generated from the following files: