|
NAG[g05kbc] NAG[nag_rngs_init_repeatable] - Initialize seeds of a given generator for random number generating functions (that pass seeds explicitly) to give a repeatable sequence
|
|
Calling Sequence
g05kbc(igen, iseed)
nag_rngs_init_repeatable(. . .)
Parameters
|
igen - assignable;
|
|
|
Note: On exit the variable igen will have a value of type integer.
|
|
On entry: must contain the identification number for the generator to be used to return a pseudo-random number and should remain unchanged until a re-initialization by a call to one of the functions nag_rngs_init_repeatable (g05kbc) or g05kcc (nag_rngs_init_nonrepeatable). The values that may be chosen are:
|
|
, the basic generator;
|
|
, a Wichman–Hill generator.
|
|
See the g05 Chapter Introduction for details.
|
|
|
iseed - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
On entry: must contain values which are used to obtain an initial state for the generator selected by the argument igen. The treatment of the array iseed differs depending on the value of igen input. As a result, the requirements for meaningful values of the elements of iseed also depend on igen; these requirements are as follows:
|
|
if , only need be set to any non-negative integer;
|
|
otherwise, all elements of iseed must be set and should be positive and are recommended to be at least five digits in length.
|
|
On exit: contains initial seeds for the selected generator.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_rngs_init_repeatable (g05kbc) sets the initial seeds for the selected generator as used by and passed to the group of pseudo-random number functions g05k–g05q.
|
|
Description
|
|
nag_rngs_init_repeatable (g05kbc) sets the seeds used by the selected generator mechanism (see the g05 Chapter Introduction) to values calculated from the argument array iseed. The pseudo-random number generator is selected by the input value of the argument igen.
For the same value of igen, this function will yield different subsequent sequences of random numbers if called with different values of iseed, but the sequences, if calculated sequentially, will be repeatable in different runs of the calling program. It should be noted that there is no guarantee of statistical properties between sequences, only within sequences.
|
|
Error Indicators and Warnings
|
|
None.
|
|
|
Examples
|
|
>
|
igen := 1:
iseed := Vector([1762543, 9324783, 42344, 742355], datatype=integer[kernelopts('wordsize')/8]):
NAG:-g05kbc(igen, iseed):
|
|
|
Download Help Document
Was this information helpful?