Singleton class for integrating the Boost Random Number Library with uBLAS vectors and matrices.
Implemented as a singleton to ensure that all random numbers are created from the same pseudo-random number generation pool. This is designed to prevent un-intentional correlation between random series in different parts of the application.
Because all of the methods are declared static, the developer never actually creates a class of this type.
typedef boost::kreutzer1986 random_type |
Defines the class for the basic random number generator.
This implementation combines a linear congruential generator with a shuffling algorithm.
randgen | ( | ) | [inline, private] |
Don't allow users to construct this class.
static void fill | ( | matrix< T > & | result, | |
Random & | rand | |||
) | [inline, static, private] |
Quickly fill a matrix with random numbers.
Designed to handle both double and complex<double> matrices.
result | Matrix of random numbers. | |
rand | Random number generator. |
static void fill | ( | vector< T > & | result, | |
Random & | rand | |||
) | [inline, static, private] |
Quickly fill a vector with random numbers.
Designed to handle both double and complex<double> vectors.
result | Vector of random numbers. | |
rand | Random number generator. |
static matrix<double> gaussian | ( | int | N, | |
int | M | |||
) | [inline, static] |
Generate a matrix of random numbers from a Gaussian distribution.
N | Rows of the output matrix. | |
M | Columns of the output matrix. |
static vector<double> gaussian | ( | int | N | ) | [inline, static] |
Generate a vector of random numbers from a Gaussian distribution.
N | Length of the output vector. |
static double gaussian | ( | ) | [inline, static] |
Generate a single random number from a Gaussian distribution.
static matrix< complex<double> > noise | ( | int | N, | |
int | M | |||
) | [inline, static] |
Generate a matrix of complex random numbers from a Gaussian distribution.
N | Rows of the output matrix. | |
M | Columns of the output matrix. |
static vector< complex<double> > noise | ( | int | N | ) | [inline, static] |
Generate a vector of complex random numbers from a Gaussian distribution.
N | Length of the output vector. |
static void seed | ( | random_type::result_type | value | ) | [inline, static] |
Initialize the random number generator with a specific seed.
This allows the system to re-create random signals from run-to-run.
value | New seed for the random number generator. |
static matrix<double> uniform | ( | int | N, | |
int | M | |||
) | [inline, static] |
Generate a matrix of random numbers from a Uniform distribution.
N | Rows of the output matrix. | |
M | Columns of the output matrix. |
static vector<double> uniform | ( | int | N | ) | [inline, static] |
Generate a vector of random numbers from a Uniform distribution.
N | Length of the output vector. |
static double uniform | ( | ) | [inline, static] |
Generate a single random number from a Uniform distribution.
boost::normal_distribution< double > gaussian_dist [static, private] |
variate_generator<> requires reference to abstract distribution.
boost::variate_generator< randgen::random_type, boost::normal_distribution< double > > gaussian_gen [static, private] |
Gaussian random number generator with sigma = 1.
Gaussian ransom number generator with sigma = 1.
randgen::random_type master_gen [static, private] |
Master generator that underlies all distributions.
Seeded with the current system time at initialization.
boost::uniform_01< randgen::random_type, double > uniform_gen [static, private] |
Uniform random number generator for the range [0,1).