Random numbers

The generation of random numbers is based on the state of the generator, stored in an implementation-specific structure of type RandomState. The following functions are provided for seeding and accessing random numbers.

name
RealF QLA_random(RandomState *s);
RealF QLA_gaussian(RandomState *s);
void QLA_seed_random(RandomState *s, Int seed, Int i);

The first of these returns a random real value uniformly distributed on [0,1]. The second returns a real Gaussian normal deviate N(0,1). The third seeds a single random number generator from a pair of integers seed, i. In typical usage, many generators are maintained. Thus the integer i distinguishes them and the integer seed seeds it, resulting in the initial state s. It is assumed that storage for the state s has been allocated prior to the call.



James Osborn 2006-06-25