#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:
Functions | |
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: ![]() | |
double | normal_drandom (void) |
Returns a univariate, normally-distributed, random double-precision real number ![]() | |
void | normal_drandom (double &x, double &y) |
Generates a pair of univariate normal random numbers: ![]() | |
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 ![]() |
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.