naginterfaces.library.rand.init_​leapfrog

naginterfaces.library.rand.init_leapfrog(n, k, statecomm)[source]

init_leapfrog allows for the generation of multiple, independent, sequences of pseudorandom numbers using the leap-frog method.

For full information please refer to the NAG Library document for g05kh

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/g05/g05khf.html

Parameters
nint

, the total number of sequences required.

kint

, the number of the current sequence.

statecommdict, RNG communication object, modified in place

RNG communication structure.

This argument must have been initialized by a prior call to init_repeat() or init_nonrepeat().

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, [‘state’] vector has been corrupted or not initialized.

(errno )

On entry, cannot use leap-frog with the base generator defined by [‘state’].

Notes

init_leapfrog adjusts a base generator to allow multiple, independent, sequences of pseudorandom numbers to be generated via the leap-frog method (see the G05 Introduction for details).

If, prior to calling init_leapfrog the base generator defined by [‘state’] would produce random numbers , then after calling init_leapfrog the generator will produce random numbers .

One of the initialization functions init_repeat() (for a repeatable sequence if computed sequentially) or init_nonrepeat() (for a non-repeatable sequence) must be called prior to the first call to init_leapfrog.

The leap-frog algorithm can be used in conjunction with the NAG basic generator, both the Wichmann–Hill I and Wichmann–Hill II generators, the Mersenne Twister and L’Ecuyer.

References

Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley