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

random.h File Reference

The header file for random number generators. More...

#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <complex>

Include dependency graph for random.h:

This graph shows which files directly or indirectly include this file:


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

The header file for random number generators.

This header file contains function prototypes for random number routines. In addition to initializing the random number generator, it provides uniform distributions on the real unit interval and the complex unit disc. It also provides univariate Gaussian distributions on the real line and complex plane. These functions are used to generate random vectors, but can also be used independently.

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