public class MRG32k3a extends RandomStreamBase
RandomStreamBase by using as a
backbone (or main) generator the combined multiple recursive
generator (CMRG) MRG32k3a proposed by L'Ecuyer,
implemented in 64-bit floating-point arithmetic.
This backbone generator has a period length of
ρ = 2191.
The values of V, W, and Z are 251, 276, and 2127,
respectively. (See RandomStream for their definition.)
The seed of the RNG, and the state of a stream at any given step,
are six-dimensional vectors of 32-bit integers, stored in double.
The default initial seed of the RNG is
(12345, 12345, 12345, 12345, 12345, 12345).| Constructor and Description |
|---|
MRG32k3a()
Constructs a new stream, initializes its seed Ig,
sets Bg and Cg equal to Ig, and sets its antithetic switch
to false.
|
MRG32k3a(java.lang.String name)
Constructs a new stream with an identifier name
(used when printing the stream state).
|
| Modifier and Type | Method and Description |
|---|---|
MRG32k3a |
clone()
Clones the current generator and return its copy.
|
long[] |
getState()
Returns the current state Cg of this stream.
|
void |
resetNextSubstream()
Reinitializes the stream to the beginning of its next
substream: Ng is computed, and
Cg and Bg are set to Ng.
|
void |
resetStartStream()
Reinitializes the stream to its initial state Ig:
Cg and Bg are set to Ig.
|
void |
resetStartSubstream()
Reinitializes the stream to the beginning of its current
substream: Cg is set to Bg.
|
static void |
setPackageSeed(long[] seed)
Sets the initial seed for the class MRG32k3a to the
six integers in the vector seed[0..5].
|
void |
setSeed(long[] seed)
Sets the initial seed Ig of this stream
to the vector seed[0..5].
|
java.lang.String |
toString()
Returns a string containing the name and the current state Cg
of this stream.
|
java.lang.String |
toStringFull()
Returns a string containing the name of this stream and the
values of all its internal variables.
|
formatState, formatStateFull, increasedPrecision, nextArrayOfDouble, nextArrayOfInt, nextDouble, nextIntpublic MRG32k3a()
setPackageSeed if this is the first stream created,
otherwise it is Z steps ahead of that of the stream most recently
created in this class.public MRG32k3a(java.lang.String name)
name - name of the streampublic static void setPackageSeed(long[] seed)
seed - array of 6 elements representing the seedpublic void setSeed(long[] seed)
seed - array of 6 integers representing the new seedpublic void resetStartStream()
RandomStreamresetStartStream in interface RandomStreamresetStartStream in class RandomStreamBasepublic void resetStartSubstream()
RandomStreamresetStartSubstream in interface RandomStreamresetStartSubstream in class RandomStreamBasepublic void resetNextSubstream()
RandomStreamresetNextSubstream in interface RandomStreamresetNextSubstream in class RandomStreamBasepublic long[] getState()
public java.lang.String toString()
toString in interface RandomStreamtoString in class RandomStreamBasepublic java.lang.String toStringFull()
public MRG32k3a clone()
clone in interface CloneableRandomStreamclone in class RandomStreamBaseTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.