Class MersenneTwister64
- java.lang.Object
-
- com.opengamma.strata.math.impl.cern.RandomEngine
-
- com.opengamma.strata.math.impl.cern.MersenneTwister
-
- com.opengamma.strata.math.impl.cern.MersenneTwister64
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DoubleUnaryOperator
,IntUnaryOperator
public class MersenneTwister64 extends MersenneTwister
Same as MersenneTwister except that method raw() returns 64 bit random numbers instead of 32 bit random numbers.- Version:
- 1.0, 09/24/99
- See Also:
MersenneTwister
, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.opengamma.strata.math.impl.cern.MersenneTwister
DEFAULT_SEED
-
-
Constructor Summary
Constructors Constructor Description MersenneTwister64()
Constructs and returns a random number generator with a default seed, which is a constant.MersenneTwister64(int seed)
Constructs and returns a random number generator with the given seed.MersenneTwister64(Date d)
Constructs and returns a random number generator seeded with the given date.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
raw()
Returns a 64 bit uniformly distributed random number in the open unit interval(0.0,1.0)
(excluding 0.0 and 1.0).-
Methods inherited from class com.opengamma.strata.math.impl.cern.MersenneTwister
clone, nextBlock, nextInt, setSeed
-
Methods inherited from class com.opengamma.strata.math.impl.cern.RandomEngine
applyAsDouble, applyAsInt, makeDefault, nextDouble, nextFloat, nextLong
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.DoubleUnaryOperator
andThen, compose
-
Methods inherited from interface java.util.function.IntUnaryOperator
andThen, compose
-
-
-
-
Constructor Detail
-
MersenneTwister64
public MersenneTwister64()
Constructs and returns a random number generator with a default seed, which is a constant.
-
MersenneTwister64
public MersenneTwister64(int seed)
Constructs and returns a random number generator with the given seed.- Parameters:
seed
- should not be 0, in such a case MersenneTwister64.DEFAULT_SEED is silently substituted.
-
MersenneTwister64
public MersenneTwister64(Date d)
Constructs and returns a random number generator seeded with the given date.- Parameters:
d
- typically new java.util.Date()
-
-
Method Detail
-
raw
public double raw()
Returns a 64 bit uniformly distributed random number in the open unit interval(0.0,1.0)
(excluding 0.0 and 1.0).- Overrides:
raw
in classRandomEngine
- Returns:
- the random number
-
-