randomSeedSet

Initializes a random seed for use in the IMSL random number generators.

Synopsis

randomSeedSet (seed)

Required Arguments

int seed (Input)
The seed of the random number generator. The argument seed must be in the range (0, 2147483646). If seed is zero, a value is computed using the system clock. Hence, the results of programs using the IMSL random number generators will be different at various times.

Description

The function randomSeedSet is used to initialize the seed used in the PyIMSL random number generators. The form of the generators is

\[x_i \equiv cx_{i-1} mod (2^{31} − 1)\]

The value of \(x_0\) is the seed. If the seed is not initialized prior to invocation of any of the routines for random number generation by calling randomSeedSet, the seed is initialized via the system clock. The seed can be reinitialized to a clock-dependent value by calling randomSeedSet with seed set to 0.

The effect of randomSeedSet is to set some global values used by the random number generators.

A common use of randomSeedSet is in conjunction with randomSeedGet to restart a simulation.

Example

See function randomSeedGet.