previous next Up Title Contents

UtRandom Module


The Ran01_Random(...) Routine

Syntax

double Ran01_Random(long *seed);


Description
This routine initialises the random number generator. It has been revised from the "Numerical Recipes 2nd ed." Ran1 (p.280). Set "seed" to any negative value to initialise or re-intialise the sequence.


Returns
random real number.


Example(s)
GeomDist_Random(...) routine.

The GeomDist_Random(...) Routine

Syntax
int GeomDist_Random(double probability, int numTrials);


Description
This routine calculates the number of times that an event occurs with a set probability and number of trials, numTrials. It uses the gemotric distribution method, but the probability must be small.


Returns
integer number of events.


Example(s)
ANSpikeGen_Simple module.

The SetGlobalSeed_Random(...) Routine

Syntax
void SetGlobalSeed_Random(double probability, int numTrials);


Description
This routine sets the global random number seed for the module.


Returns
None.


Example(s)


previous next Up Title Contents