CSIM: randgen.cpp File Reference

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).


 
(C) 2003, Thomas Natschläger last modified 07/10/2006