- java.lang.Object
-
- net.finmath.randomnumbers.MersenneTwister
-
- All Implemented Interfaces:
Serializable
,DoubleSupplier
,RandomNumberGenerator
,RandomNumberGenerator1D
public class MersenneTwister extends Object implements RandomNumberGenerator1D, Serializable
Mersenne Twister random number generator. This class is just a wrapper oforg.apache.commons.math3.random.MersenneTwister
.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MersenneTwister()
MersenneTwister(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
nextDouble()
Returns the next random number in the sequence.double
nextDoubleFast()
Possibly faster, non-thread safe implementation returning the next double value of this random number generator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.finmath.randomnumbers.RandomNumberGenerator1D
getAsDouble, getDimension, getNext
-
-
-
-
Method Detail
-
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
-
-