|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Random net.sourceforge.cilib.math.random.generator.Random net.sourceforge.cilib.math.random.generator.MersenneTwister
public class MersenneTwister
This is an implementation of the MT19937 random number generator.
The MT19937 generator of Makoto Matsumoto and Takuji Nishimura is a variant of the twisted generalized feedback shift-register algorithm, and is known as the "Mersenne Twister" generator. It has a Mersenne prime period of 2^19937 - 1 (about 10^6000) and is equi-distributed in 623 dimensions. It has passed the DIEHARD statistical tests. It uses 624 words of state per generator and is comparable in speed to the other simulation quality generators. The original generator used a default seed of 4357 and setting the seed equal to zero
- Brian Gough
reproduces this. References:
This code is based on the implementation in GSL (GNU Scientific Library) which is also covered by the GNU General Public License. The original C source code is Copyright (C) 1998 Brian Gough. Comment text ripped from GSL.
Constructor Summary | |
---|---|
MersenneTwister()
Default Constructor. |
|
MersenneTwister(long seed)
Create a MersenneTwister with the given seed value. |
|
MersenneTwister(MersenneTwister copy)
Copy constructor. |
Method Summary | |
---|---|
MersenneTwister |
getClone()
Get a cloned instance of the current object. |
protected int |
next(int bits)
|
double |
nextDouble()
|
void |
setSeed(long seed)
|
Methods inherited from class java.util.Random |
---|
nextBoolean, nextBytes, nextFloat, nextGaussian, nextInt, nextInt, nextLong |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MersenneTwister()
Seeder.getSeed()
.
public MersenneTwister(long seed)
seed
- The initial seed value to use.public MersenneTwister(MersenneTwister copy)
copy
- The instance to copy.Method Detail |
---|
public MersenneTwister getClone()
getClone
in interface Cloneable
getClone
in class Random
Object.clone()
public void setSeed(long seed)
setSeed
in class Random
protected int next(int bits)
next
in class Random
public double nextDouble()
nextDouble
in class Random
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |