randgen Class Reference
[Random Numbers]


Detailed Description

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

randgen (  )  [inline, private]

Don't allow users to construct this class.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
N Length of the output vector.
static double uniform (  )  [inline, static]

Generate a single random number from a Uniform distribution.


Member Data Documentation

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).


Generated on 4 May 2015 for USML by  doxygen 1.6.1