random¶
Namespaces¶
Structs¶
normal¶
uniform¶
-
template<typename T = double>
struct uniform¶
Functions¶
GENERATOR¶
Warning
doxygenfunction: Unable to resolve function “ioh::common::random::GENERATOR” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expected identifier in nested name, got keyword: thread_local [error at 12] thread_local std::mt19937 GENERATOR (std::random_device{}()) ————^ If the function has a return type: Invalid C++ declaration: Expected identifier in nested name, got keyword: thread_local [error at 12] thread_local std::mt19937 GENERATOR (std::random_device{}()) ————^
doubles¶
-
inline std::vector<double> ioh::common::random::doubles(const unsigned int n, const double min = 0.0, const double max = 1.0)¶
This function returns a vector random uniform doubles within the range [min, max].
- Parameters:
n – The size of the vector
min – the minimal boundary
max – the maximum boundary
- Returns:
vector of uniform random doubles
integer¶
-
inline int ioh::common::random::integer(const int min = std::numeric_limits<int>::min(), const int max = std::numeric_limits<int>::max())¶
This function returns a random uniform integer within the range [min, max].
- Parameters:
min – the minimal boundary
max – the maximum boundary
- Returns:
a random uniform integer
integers¶
-
inline std::vector<int> ioh::common::random::integers(const unsigned int n, const int min = std::numeric_limits<int>::min(), const int max = std::numeric_limits<int>::max())¶
This function returns a vector of random uniform integer within the range [min, max] of size n.
- Parameters:
n – The size of the vector
min – The minimal boundary
max – The maximum boundary
- Returns:
A vector of uniform random integers
lcg_rand¶
-
inline long ioh::common::random::lcg_rand(long seed)¶
Linear congruential generator using a given seed.
Used to generate uniform random numbers.
- Parameters:
seed – Random seed
- Returns:
A new seed
real¶
-
inline double ioh::common::random::real(const double min = 0.0, const double max = 1.0)¶
This function returns a random uniform double within the range [min, max].
- Parameters:
min – the minimal boundary
max – the maximum boundary
- Returns:
a random double
seed¶
-
inline void ioh::common::random::seed(const unsigned int seed)¶
Seed the random number generator of the calling thread.
This is a std::mt19937 rng
Variables¶
RD¶
-
std::random_device ioh::common::random::RD¶
Global random device.