|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.rng.RandomStreamBase umontreal.iro.lecuyer.rng.MT19937
public class MT19937
Implements the RandomStream
interface via inheritance from
RandomStreamBase
. The backbone generator is the MT19937
Mersenne Twister, proposed by Matsumoto and Nishimura, which has a state size of 19937 bits and a period length of
approximatively 219937.
Each instance uses another CloneableRandomStream
to fill its initial state.
With this design, the initial states of successive streams are not
spaced by an equal number of steps, and there is no guarantee that
different streams do not overlap, but damaging overlap is unlikely
because of the huge size of the state space.
The seed of the RNG, and the state of a stream at any given
step, is a 624-dimensional vector of 32-bit integers.
The output of nextValue has 32 bits of precision.
Constructor Summary | |
---|---|
MT19937(CloneableRandomStream rng)
Constructs a new stream, using rng to fill its initial state. |
|
MT19937(CloneableRandomStream rng,
String name)
Constructs a new stream with the identifier name (used in the toString method). |
Method Summary | |
---|---|
MT19937 |
clone()
Clones the current generator and return its copy. |
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. |
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 MT19937(CloneableRandomStream rng)
rng
- used to build the seedpublic MT19937(CloneableRandomStream rng, String name)
rng
- used to build the seedname
- name of the streamMethod Detail |
---|
public MT19937 clone()
clone
in interface CloneableRandomStream
clone
in class RandomStreamBase
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 String toString()
RandomStream
toString
in interface RandomStream
toString
in class RandomStreamBase
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |