g05kh allows for the generation of multiple, independent, sequences of pseudorandom numbers using the leap-frog method.
public static void g05kh( int n, int k, G05..::..G05State g05state, out int ifail )
Public Shared Sub g05kh ( _ n As Integer, _ k As Integer, _ g05state As G05..::..G05State, _ <OutAttribute> ByRef ifail As Integer _ )
public: static void g05kh( int n, int k, G05..::..G05State^ g05state, [OutAttribute] int% ifail )
static member g05kh : n : int * k : int * g05state : G05..::..G05State * ifail : int byref -> unit
- Type: System..::..Int32On entry: , the total number of sequences required.Constraint: .
- Type: System..::..Int32On entry: , the number of the current sequence.Constraint: .
g05kh adjusts a base generator to allow multiple, independent, sequences of pseudorandom numbers to be generated via the leap-frog method (see the G05 class for details).
If, prior to calling g05kh the base generator defined by state would produce random numbers , then after calling g05kh the generator will produce random numbers .
One of the initialization methods (G05KFF not in this release) (for a repeatable sequence if computed sequentially) or (G05KGF not in this release) (for a non-repeatable sequence) must be called prior to the first call to g05kh.
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.
Knuth D E (1981) The Art of Computer Programming (Volume 2) (2nd Edition) Addison–Wesley
Errors or warnings detected by the method:
On entry, . On entry, . On entry, state vector was not initialized or has been corrupted.
- On entry, cannot use the leap-frog method with the base generator defined by state.
The leap-frog method tends to be less efficient than other methods of producing multiple, independent sequences. See the G05 class for alternative choices.