Chebyshev
Unit testing for scientific software
|
Pseudorandom number generation and sampling module. More...
Classes | |
class | random_settings |
Settings for the random module. More... | |
Functions | |
void | setup (uint64_t seed=0) |
Initialize the random module. | |
uint64_t | natural () |
Generate a random natural number. | |
long double | uniform (long double a, long double b) |
Generate a uniformly distributed random number. More... | |
template<typename Vector > | |
Vector & | sample_uniform (Vector &x, const std::vector< prec::interval > intervals) |
Fill an already allocated vector with uniformly distributed numbers over different intervals. More... | |
long double | gaussian (long double m, long double s) |
Generate a Gaussian distributed random number. More... | |
std::string | string (size_t length) |
Generate a random string made of human-readable ASCII characters. More... | |
std::string | string (size_t length, std::string alphabet) |
Generate a random string made of the elements of the given alphabet. More... | |
std::string | string (size_t length, std::vector< char > alphabet) |
Generate a random string made of the elements of the given alphabet. More... | |
template<typename T > | |
std::vector< T > | string (size_t length, std::vector< T > alphabet) |
Generate a random string made of the elements of the given alphabet, of arbitrary type. More... | |
Variables | |
struct chebyshev::random::random_settings | settings |
Pseudorandom number generation and sampling module.
|
inline |
Generate a Gaussian distributed random number.
m | The mean of the distribution |
s | The standard deviation of the distribution |
|
inline |
Fill an already allocated vector with uniformly distributed numbers over different intervals.
x | The already initialized vector to fill. |
intervals | The intervals to generate over. |
|
inline |
Generate a random string made of human-readable ASCII characters.
length | The length of the string to generate |
|
inline |
Generate a random string made of the elements of the given alphabet.
length | The length of the string to generate |
alphabet | A string containing the elements of the alphabet. |
|
inline |
Generate a random string made of the elements of the given alphabet.
length | The length of the string to generate. |
alphabet | A vector containing the elements of the alphabet. |
|
inline |
Generate a random string made of the elements of the given alphabet, of arbitrary type.
length | The length of the string to generate |
|
inline |
Generate a uniformly distributed random number.
a | The lower extreme of the interval |
b | The upper extreme of the interval |