Random number generation (wrapper for boost). An instance of this class cannot be used by multiple threads at once (member functions are not const). However, the constructor is thread safe and different instances can be used safely in any number of threads. It is also guaranteed that all created instances will have a "random" random seed.
More...
#include <random_numbers.h>
|
double | gaussian (double mean, double stddev) |
| Generate a random real using a normal distribution with given mean and variance. More...
|
|
double | gaussian01 (void) |
| Generate a random real using a normal distribution with mean 0 and variance 1. More...
|
|
boost::uint32_t | getFirstSeed () |
| Allow the randomly generated seed to be saved so that experiments / benchmarks can be recreated in the future. More...
|
|
void | quaternion (double value[4]) |
| Uniform random unit quaternion sampling. The computed value has the order (x,y,z,w) More...
|
|
| RandomNumberGenerator (boost::uint32_t seed) |
| Constructor. Allow a seed to be specified for deterministic behaviour. More...
|
|
| RandomNumberGenerator (void) |
| Constructor. Always sets a "random" random seed. More...
|
|
double | uniform01 (void) |
| Generate a random real between 0 and 1. More...
|
|
int | uniformInteger (int min, int max) |
| Generate an integer uniformly at random within a specified range (inclusive) More...
|
|
double | uniformReal (double lower_bound, double upper_bound) |
| Generate a random real within given bounds: [lower_bound, upper_bound) More...
|
|
|
boost::mt19937 | generator_ |
|
boost::variate_generator< boost::mt19937 &, boost::normal_distribution<> > | normal_ |
|
boost::normal_distribution | normalDist_ |
|
boost::variate_generator< boost::mt19937 &, boost::uniform_real<> > | uni_ |
|
boost::uniform_real | uniDist_ |
|
Random number generation (wrapper for boost). An instance of this class cannot be used by multiple threads at once (member functions are not const). However, the constructor is thread safe and different instances can be used safely in any number of threads. It is also guaranteed that all created instances will have a "random" random seed.
Definition at line 86 of file random_numbers.h.
◆ RandomNumberGenerator() [1/2]
random_numbers::RandomNumberGenerator::RandomNumberGenerator |
( |
void |
| ) |
|
◆ RandomNumberGenerator() [2/2]
random_numbers::RandomNumberGenerator::RandomNumberGenerator |
( |
boost::uint32_t |
seed | ) |
|
Constructor. Allow a seed to be specified for deterministic behaviour.
Definition at line 82 of file random_numbers.cpp.
◆ gaussian()
double random_numbers::RandomNumberGenerator::gaussian |
( |
double |
mean, |
|
|
double |
stddev |
|
) |
| |
|
inline |
Generate a random real using a normal distribution with given mean and variance.
Definition at line 150 of file random_numbers.h.
◆ gaussian01()
double random_numbers::RandomNumberGenerator::gaussian01 |
( |
void |
| ) |
|
|
inline |
Generate a random real using a normal distribution with mean 0 and variance 1.
Definition at line 144 of file random_numbers.h.
◆ getFirstSeed()
boost::uint32_t random_numbers::RandomNumberGenerator::getFirstSeed |
( |
| ) |
|
Allow the randomly generated seed to be saved so that experiments / benchmarks can be recreated in the future.
Definition at line 105 of file random_numbers.cpp.
◆ quaternion()
void random_numbers::RandomNumberGenerator::quaternion |
( |
double |
value[4] | ) |
|
Uniform random unit quaternion sampling. The computed value has the order (x,y,z,w)
- Parameters
-
value[4] | A four dimensional array in which the computed quaternion will be returned |
Definition at line 91 of file random_numbers.cpp.
◆ uniform01()
double random_numbers::RandomNumberGenerator::uniform01 |
( |
void |
| ) |
|
|
inline |
◆ uniformInteger()
int random_numbers::RandomNumberGenerator::uniformInteger |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
|
inline |
Generate an integer uniformly at random within a specified range (inclusive)
Definition at line 161 of file random_numbers.h.
◆ uniformReal()
double random_numbers::RandomNumberGenerator::uniformReal |
( |
double |
lower_bound, |
|
|
double |
upper_bound |
|
) |
| |
|
inline |
Generate a random real within given bounds: [lower_bound, upper_bound)
- Parameters
-
lower_bound | The lower bound |
upper_bound | The upper bound |
Definition at line 138 of file random_numbers.h.
◆ generator_
boost::mt19937 random_numbers::RandomNumberGenerator::generator_ |
|
private |
◆ normal_
boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > random_numbers::RandomNumberGenerator::normal_ |
|
private |
◆ normalDist_
boost::normal_distribution random_numbers::RandomNumberGenerator::normalDist_ |
|
private |
◆ uni_
boost::variate_generator<boost::mt19937&, boost::uniform_real<> > random_numbers::RandomNumberGenerator::uni_ |
|
private |
◆ uniDist_
boost::uniform_real random_numbers::RandomNumberGenerator::uniDist_ |
|
private |
The documentation for this class was generated from the following files: