random_seed_set
Initializes a random seed for use in the random number generators.
Synopsis
#include <imsls.h>
void imsls_random_seed_set (int 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 0, a value is computed using the system clock; hence, the results of programs using the random number generators will be different at various times.
Description
Function imsls_random_seed_set is used to initialize the seed used in the random number generators. The form of the generators is as follows:
xi ≡ cxi−1mod (231 − 1)
The value of x0 is the seed. If the seed is not initialized prior to invocation of any of the functions for random number generation by calling imsls_random_seed_set, the seed is initialized by the system clock. The seed can be reinitialized to a clock-dependent value by calling imsls_random_seed_set with seed set to 0.
The effect of
imsls_random_seed_set is to set some global values used by the random number generators. A common use of
imsls_random_seed_set is in conjunction with function
imsls_random_seed_get to restart a simulation.
Example