Public Member Functions | Private Attributes
random_numbers::RandomNumberGenerator Class Reference

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>

List of all members.

Public Member Functions

double gaussian (double mean, double stddev)
 Generate a random real using a normal distribution with given mean and variance.
double gaussian01 (void)
 Generate a random real using a normal distribution with mean 0 and variance 1.
boost::uint32_t getFirstSeed ()
 Allow the randomly generated seed to be saved so that experiments / benchmarks can be recreated in the future.
void quaternion (double value[4])
 Uniform random unit quaternion sampling. The computed value has the order (x,y,z,w)
 RandomNumberGenerator (void)
 Constructor. Always sets a "random" random seed.
 RandomNumberGenerator (boost::uint32_t seed)
 Constructor. Allow a seed to be specified for deterministic behaviour.
double uniform01 (void)
 Generate a random real between 0 and 1.
int uniformInteger (int min, int max)
 Generate an integer uniformly at random within a specified range (inclusive)
double uniformReal (double lower_bound, double upper_bound)
 Generate a random real within given bounds: [lower_bound, upper_bound)

Private Attributes

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_

Detailed Description

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 54 of file random_numbers.h.


Constructor & Destructor Documentation

Constructor. Always sets a "random" random seed.

Definition at line 73 of file random_numbers.cpp.

Constructor. Allow a seed to be specified for deterministic behaviour.

Definition at line 81 of file random_numbers.cpp.


Member Function Documentation

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 87 of file random_numbers.h.

Generate a random real using a normal distribution with mean 0 and variance 1.

Definition at line 81 of file random_numbers.h.

Allow the randomly generated seed to be saved so that experiments / benchmarks can be recreated in the future.

Definition at line 107 of file random_numbers.cpp.

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 94 of file random_numbers.cpp.

Generate a random real between 0 and 1.

Definition at line 65 of file random_numbers.h.

int random_numbers::RandomNumberGenerator::uniformInteger ( int  min,
int  max 
) [inline]

Generate an integer uniformly at random within a specified range (inclusive)

Definition at line 98 of file random_numbers.h.

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_boundThe lower bound
upper_boundThe upper bound

Definition at line 75 of file random_numbers.h.


Member Data Documentation

Definition at line 111 of file random_numbers.h.

boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > random_numbers::RandomNumberGenerator::normal_ [private]

Definition at line 115 of file random_numbers.h.

boost::normal_distribution random_numbers::RandomNumberGenerator::normalDist_ [private]

Definition at line 113 of file random_numbers.h.

boost::variate_generator<boost::mt19937&, boost::uniform_real<> > random_numbers::RandomNumberGenerator::uni_ [private]

Definition at line 114 of file random_numbers.h.

boost::uniform_real random_numbers::RandomNumberGenerator::uniDist_ [private]

Definition at line 112 of file random_numbers.h.


The documentation for this class was generated from the following files:


random_numbers
Author(s): Ioan Sucan
autogenerated on Thu Aug 27 2015 14:38:08