|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.rng.RandomStreamBase
umontreal.iro.lecuyer.rng.MRG31k3p
public class MRG31k3p
MRG31k3p
Extends the abstract class RandomStreamBase, thus implementing the RandomStream interface indirectly. The backbone generator is the combined multiple recursive generator (CMRG) MRG31k3p proposed by L'Ecuyer and Touzin[#!rLEC00b!#], implemented in 32-bit integer arithmetic. This RNG has a period length of approximately 2185. The values of V, W and Z are 262, 272 and 2134 respectively. (See RandomStream for their definition.) The seed and the state of a stream at any given step are six-dimensional vectors of 32-bit integers. The default initial seed is (12345, 12345, 12345, 12345, 12345, 12345). The method nextValue provides 31 bits of precision.
The difference between the RNG of class MRG32k3a and this one is that this one has all its coefficients of the form a = ±2q±2r. This permits a faster implementation than for arbitrary coefficients. On a 32-bit computer, MRG31k3p is about twice as fast as MRG32k3a. On the other hand, the latter does a little better in the spectral test and has been more extensively tested.
Constructor Summary | |
---|---|
MRG31k3p()
. |
|
MRG31k3p(String name)
. |
Method Summary | |
---|---|
MRG31k3p |
clone()
. |
int[] |
getState()
. |
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(int[] seed)
. |
void |
setSeed(int[] seed)
. |
String |
toString()
Returns a string containing the current state of this stream. |
Methods inherited from class umontreal.iro.lecuyer.rng.RandomStreamBase |
---|
formatState, formatStateFull, increasedPrecision, nextArrayOfDouble, nextArrayOfInt, nextDouble, nextInt |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MRG31k3p()
public MRG31k3p(String name)
Method Detail |
---|
public static void setPackageSeed(int[] seed)
public void setSeed(int[] seed)
public void resetStartStream()
RandomStream
resetStartStream
in interface RandomStream
resetStartStream
in class RandomStreamBase
public void resetStartSubstream()
RandomStream
resetStartSubstream
in interface RandomStream
resetStartSubstream
in class RandomStreamBase
public void resetNextSubstream()
RandomStream
resetNextSubstream
in interface RandomStream
resetNextSubstream
in class RandomStreamBase
public int[] getState()
public MRG31k3p clone()
clone
in interface CloneableRandomStream
clone
in class RandomStreamBase
public String toString()
RandomStream
toString
in interface RandomStream
toString
in class RandomStreamBase
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |