Next: , Previous: DRANDINITIALIZEUSER, Up: User Supplied Generators


UINI

Specification for a user supplied initialization routine.

— SUBROUTINE: UINI (GENID,SUBID,SEED,LSEED,STATE,LSTATE,INFO)
— Input: INTEGER GENID

On input: the ID associated with the generator. It may be used for anything you like.

— Input: INTEGER SUBID

On input: the sub-ID associated with the generator. It may be used for anything you like.

— Input: INTEGER SEED(LSEED)

On input: an array containing the initial seed for your generator.

— Input/Output: INTEGER LSEED

On input: either the size of the SEED array, or a value < 1.
On output: if LSEED<1 on entry, LSEED must be set to the required size of the SEED array. This allows a caller of UINI to query the required size.

— Output: INTEGER STATE(LSTATE)

On output: if LSTATE<1 on entry, STATE should be unchanged.
Otherwise, STATE is a state vector holding internal details required by your generator. On exit from UINI, the array STATE must hold the following information:

STATE(1) = ESTATE, where ESTATE is your minimum allowed size of array STATE.

STATE(2) = MAGIC, where MAGIC is a magic number of your own choice. This can be used by your routine UGEN as a check that UINI has previously been called.

STATE(3) = GENID

STATE(4) = SUBID

STATE(5) ... STATE(ESTATE-1) = internal state values required by your generator routine UGEN; for example, the current value of your seed.

STATE(ESTATE) = MAGIC, i.e. the same value as STATE(2).

— Input/Output: INTEGER LSTATE

On input: either the size of the STATE array, or a value < 1.
On output: if LSTATE<1 on entry, LSTATE should be set to the required size of the STATE array, i.e. the value ESTATE as described above. This allows the caller of UINI to query the required size.
Constraint: either LSTATE<1 or LSTATE>=ESTATE .

— Output: INTEGER INFO

On output: an error code, to be used in whatever way you wish; for example to flag an incorrect argument to UINI. If no error is encountered, UINI must set INFO to 0.