aarand
Aaron's random distribution functions
|
Namespace containing Aaron's random distribution functions. More...
Functions | |
template<typename T = double, class Engine > | |
T | standard_uniform (Engine &eng) |
template<typename T = double, class Engine > | |
std::pair< T, T > | standard_normal (Engine &eng) |
template<typename T = double, class Engine > | |
T | standard_exponential (Engine &eng) |
template<typename T = int, class Engine > | |
T | discrete_uniform (Engine &eng, T bound) |
template<class In , class Engine > | |
void | shuffle (In values, size_t n, Engine &eng) |
template<class In , class Out , class Engine > | |
void | sample (In values, size_t n, size_t s, Out output, Engine &eng) |
template<class Out , class Engine > | |
void | sample (size_t bound, size_t s, Out output, Engine &eng) |
Namespace containing Aaron's random distribution functions.
T | Integer type. |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
eng | Instance of an RNG class like std::mt19937_64 . |
bound | Positive integer specifying the upper bound of the discrete distribution. |
[0, bound)
. In | Random-access iterator or pointer for the inputs. |
Out | Random-access iterator or pointer for the outputs. |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
[in] | values | Iterator or pointer to an array of values to sample from. |
n | Number of values in the array pointed to by values . | |
s | Number of values to sample. | |
[out] | output | Iterator or pointer to an array of length s , to store the sampled values. On return, output is filled with s sampled values from values . If s > n , values is copied into the first n elements of output and the remaining values of output are undefined. |
eng | Instance of an RNG class like std::mt19937_64 . |
Out | Random-access iterator or pointer for the outputs. |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
bound | Upper bound of the indices to sample from. | |
s | Number of values to sample. | |
[out] | output | Iterator or pointer to an array of length s , to store the sampled values. output is filled with s sampled values from the sequence of integers in {0, 1, ..., bound - 1} . If s > bound , the first n elements of output will contain the sequence of integers from 0 to bound - 1 . The remaining values of output are undefined. |
eng | Instance of an RNG class like std::mt19937_64 . |
In | Random-access iterator or pointer. |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
[in,out] | values | Iterator or pointer to an array of values to shuffle. On return, contents of values are randomly permuted in place using the Fisher-Yates algorithm. |
n | Number of values in the array pointed to by values . | |
eng | Instance of an RNG class like std::mt19937_64 . |
T | Floating point type to return. This is also used for intermediate calculations, so it is usually safest to provide a type that is at least as precise as a double . |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
eng | Instance of an RNG class like std::mt19937_64 . |
T | Floating point type to return. This is also used for intermediate calculations, so it is usually safest to provide a type that is at least as precise as a double . |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
eng | Instance of an RNG class like std::mt19937_64 . |
T aarand::standard_uniform | ( | Engine & | eng | ) |
T | Floating point type to return. This is also used for intermediate calculations, so it is usually safest to provide a type that is at least as precise as a double . |
Engine | A random number generator class with operator() , min() (static) and max() (static) methods, where the result_type is an unsigned integer value. |
eng | Instance of an RNG class like std::mt19937_64 . |