Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

random.cpp File Reference

Source code for random number generators. More...

#include "linalg/random.h"

Include dependency graph for random.cpp:


int InitRandom (void)
 Initialize the random number generator with the internal clock -- a cheap way to achieve a pseudo-random seed.
int InitRandom (int seed)
 Initializes the random number generator with the given seed -- guarantees repeatability.
double drandom (void)
 Returns a uniformly distributed random double-precision real number: $ x \in [0\ldots1]$ .
double normal_drandom (void)
 Returns a univariate, normally-distributed, random double-precision real number $ x:\ \langle x\rangle = 0, \langle x^2\rangle=1 $ .
void normal_drandom (double &x, double &y)
 Generates a pair of univariate normal random numbers: $ \langle x\rangle = \langle y\rangle = 0;\ \langle x^2\rangle=\langle y^2\rangle = 1 $ .
void crandom (std::complex< double > &c)
 Generates a uniformly distributed complex number from within the unit disc.
void normal_crandom (std::complex< double > &c)
 Generates a normally-distributed complex random number $ z: \langle z\rangle = 0;\ \langle z^*z\rangle = 1 $ .

Detailed Description

Source code for random number generators.

Generated on Wed Jun 14 22:25:27 2006 for linalg by  doxygen 1.4.4