Class LEcuyer
java.lang.Object
dev.nm.stat.random.rng.univariate.uniform.linear.LEcuyer
- All Implemented Interfaces:
RandomLongGenerator
,RandomNumberGenerator
,LinearCongruentialGenerator
,Seedable
This is the uniform random number generator recommended by L'Ecuyer in 1996.
The generator combines two MRGs.
It has a period of approximately 2185.
The first MRG has a modulus
m = 2^31-1 = 2147483647
, and
a[] = {0, 63308, -183326}
.
The second has a modulus m = 2145483479
, and
a[] = {86098, 0, -539608}
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
modulus()
Get the modulus of this linear congruential generator.double
Get the next randomdouble
.long
nextLong()
Get the next randomlong
.int
order()
Get the order of recursion.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
LEcuyer
public LEcuyer()Construct a LEcuyer pseudo uniform random generator. -
LEcuyer
public LEcuyer(long seed11, long seed12, long seed13, long seed21, long seed22, long seed23) Construct a LEcuyer pseudo uniform random generator and then seed.- Parameters:
seed11
- a seedseed12
- a seedseed13
- a seedseed21
- a seedseed22
- a seedseed23
- a seed
-
-
Method Details
-
seed
public void seed(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments. If there are not enough, i.e., fewer than 6, seeds, we recycle them. If there are more, we take the first 6 and ignore the rest. -
order
public int order()Description copied from interface:LinearCongruentialGenerator
Get the order of recursion.- Specified by:
order
in interfaceLinearCongruentialGenerator
- Returns:
- the order of recursion
-
modulus
public long modulus()Description copied from interface:LinearCongruentialGenerator
Get the modulus of this linear congruential generator.- Specified by:
modulus
in interfaceLinearCongruentialGenerator
- Returns:
- the modulus
-
nextLong
public long nextLong()Description copied from interface:RandomLongGenerator
Get the next randomlong
.- Specified by:
nextLong
in interfaceRandomLongGenerator
- Returns:
- the next random
long
-
nextDouble
public double nextDouble()Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-