java.lang.Object
net.finmath.randomnumbers.MersenneTwister
- All Implemented Interfaces:
Serializable
,DoubleSupplier
,RandomNumberGenerator
,RandomNumberGenerator1D
Mersenne Twister random number generator. This class is just a wrapper of
org.apache.commons.math3.random.MersenneTwister
.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the next random number in the sequence.double
Possibly faster, non-thread safe implementation returning the next double value of this random number generator.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.finmath.randomnumbers.RandomNumberGenerator1D
getAsDouble, getDimension, getNext
-
Constructor Details
-
MersenneTwister
public MersenneTwister(long seed) -
MersenneTwister
public MersenneTwister()
-
-
Method Details
-
nextDouble
public double nextDouble()Returns the next random number in the sequence.- Specified by:
nextDouble
in interfaceRandomNumberGenerator1D
- Returns:
- The next random number in the sequence.
-
nextDoubleFast
public double nextDoubleFast()Description copied from interface:RandomNumberGenerator1D
Possibly faster, non-thread safe implementation returning the next double value of this random number generator. The user of this method has to ensure synchronization if this generator is shared by different threads.- Specified by:
nextDoubleFast
in interfaceRandomNumberGenerator1D
- Returns:
- The next double value of this random number generator
-
toString
-