naginterfaces.library.rand.init_skipahead_power2¶
- naginterfaces.library.rand.init_skipahead_power2(n, statecomm)[source]¶
init_skipahead_power2
allows for the generation of multiple, independent, sequences of pseudorandom numbers using the skip-ahead method. The base pseudorandom number sequence defined by [‘state’] is advanced places.For full information please refer to the NAG Library document for g05kk
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g05/g05kkf.html
- Parameters
- nint
, where the number of places to skip-ahead is defined as .
- statecommdict, RNG communication object, modified in place
RNG communication structure.
This argument must have been initialized by a prior call to
init_repeat()
orinit_nonrepeat()
.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, [‘state’] vector has been corrupted or not initialized.
- (errno )
On entry, cannot use skip-ahead with the base generator defined by [‘state’].
- (errno )
On entry, the [‘state’] vector defined on initialization is not large enough to perform a skip-ahead (applies to Mersenne Twister base generator). See the initialization function
init_repeat()
orinit_nonrepeat()
.
- Notes
init_skipahead_power2
adjusts a base generator to allow multiple, independent, sequences of pseudorandom numbers to be generated via the skip-ahead method (see the G05 Introduction for details).If, prior to calling
init_skipahead_power2
the base generator defined by [‘state’] would produce random numbers , then after callinginit_skipahead_power2
the generator will produce random numbers .One of the initialization functions
init_repeat()
(for a repeatable sequence if computed sequentially) orinit_nonrepeat()
(for a non-repeatable sequence) must be called prior to the first call toinit_skipahead_power2
.The skip-ahead algorithm can be used in conjunction with any of the six base generators discussed in the G05 Introduction.
- References
Haramoto, H, Matsumoto, M, Nishimura, T, Panneton, F and L’Ecuyer, P, 2008, Efficient jump ahead for F2-linear random number generators, INFORMS J. on Computing (20(3)), 385–390
Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley