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
g05khc the base generator defined by
state would produce random numbers
, then after calling
g05khc the generator will produce random numbers
, where
. Note that the first
random numbers are discarded when using leap-frog.
One of the initialization functions
g05kfc (for a repeatable sequence if computed sequentially) or
g05kgc (for a non-repeatable sequence) must be called prior to the first call to
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.
Background information to multithreading can be found in the
Multithreading documentation.
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
g05khc, after initialization by
g05kfc. Five variates from a uniform distribution are then generated from each sequence using
g05sac.
None.