nag_rand_leap_frog (g05khc) adjusts a base generator to allow multiple, independent, sequences of pseudorandom numbers to be generated via the leap-frog method (see the
g05 Chapter Introduction for details).
If, prior to calling
nag_rand_leap_frog (g05khc) the base generator defined by
state would produce random numbers
${x}_{1},{x}_{2},{x}_{3},\dots $, then after calling
nag_rand_leap_frog (g05khc) the generator will produce random numbers
${x}_{k},{x}_{k+n},{x}_{k+2n},{x}_{k+3n},\dots $.
One of the initialization functions
nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to
nag_rand_leap_frog (g05khc).
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.
Not applicable.
The leap-frog method tends to be less efficient than other methods of producing multiple, independent sequences. See the
g05 Chapter Introduction for alternative choices.
This example creates three independent sequences using
nag_rand_leap_frog (g05khc), after initialization by
nag_rand_init_repeatable (g05kfc). Five variates from a uniform distribution are then generated from each sequence using
nag_rand_basic (g05sac).
None.