itpp::Normal_RNG Class Reference
[Random Number Generation]

Normal distribution

Normal (Gaussian) random variables, using a simplified Ziggurat method. More...

#include <random.h>

List of all members.

Public Member Functions

 Normal_RNG (double meanval, double variance)
 Constructor. Set mean and variance.
 Normal_RNG ()
 Constructor. Set mean and variance.
void setup (double meanval, double variance)
 Set mean, and variance.
void get_setup (double &meanval, double &variance) const
 Get mean and variance.
double operator() ()
 Get one sample.
vec operator() (int n)
 Get a sample vector.
mat operator() (int h, int w)
 Get a sample matrix.
double sample ()
 Get a Normal distributed (0,1) sample.
void sample_vector (int size, vec &out)
 Get a Normal distributed (0,1) vector.
void sample_matrix (int rows, int cols, mat &out)
 Get a Normal distributed (0,1) matrix.


Detailed Description

Normal distribution

Normal (Gaussian) random variables, using a simplified Ziggurat method.

For details see the following arcticle: George Marsaglia, Wai Wan Tsang, "The Ziggurat Method for Generating Random Variables", Journal of Statistical Software, vol. 5 (2000), no. 8

This implementation is based on the generator written by Jochen Voss found at http://seehuhn.de/comp/ziggurat/, which is also included in the GSL library (randlist/gauss.c).


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

Generated on Tue Jun 2 10:02:19 2009 for mixpp by  doxygen 1.5.8