Initializes a random seed for use in the IMSL random number generators.
ISEED — The seed
of the random number generator. (Input)
ISEED must be in the
range (0, 2147483646). If ISEED is zero, a value
is computed using the system clock; and, hence, the results of programs using
the IMSL random number generators will be different at different times.
Generic: CALL RNSET (ISEED)
Specific: The specific interface name is RNSET .
Single: CALL RNSET (ISEED)
Routine RNSET
is used to initialize the seed used in the IMSL random number generators. If the
seed is not initialized prior to invocation of any of the routines for random
number generation by calling RNSET,
the seed is initialized via the system clock. The seed can be reinitialized to a
clock-dependent value by calling RNSET
with ISEED
set to 0.
The effect of RNSET is to set some values in a FORTRAN COMMON block that is used by the random number generators.
A common use of RNSET is in conjunction with RNGET to restart a simulation.
The following FORTRAN statements illustrate the use of RNSET:
INTEGER ISEED
! Call RNSET to initialize the seed via the
! system clock.
CALL RNSET(0)
! Do some simulations.
...
...
! Obtain the current value of the seed.
CALL RNGET(ISEED)
! If the simulation is to be continued in a
! different program, ISEED should be output,
! possibly to a file.
...
...
! When the simulations begun above are to be
! restarted, restore ISEED to the value
! obtained above, and use as input to RNSET.
CALL RNSET(ISEED)
! Now continue the simulations.
...
...
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |