Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

randgen.cpp File Reference


Detailed Description

Implementation of some pseudo random number generators.

The core is the function uniform_rand() which is taken from Numerical Recipies in C. It is used to derive the normal distributed generator normrnd().

#include "randgen.h"

Functions


Function Documentation

double normrnd void   
 

Gaussion random variable with zero mean and variace 1.0. Taken from Numerical Cecipies in C.

void rseed long    idum
 

Set the seed of the random number generator.

double uniform_rand long *    idum
 

Long period (> 2 10 18 ) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum a negative integer to initialize; thereafter, do not alter idum between successive deviates in a sequence. RNMX should approximate the largest floating value that is less than 1.

double unirnd void   
 

Returns a random number from the interval (0,1).