Class LEcuyer
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.uniform.linear.LEcuyer
-
- All Implemented Interfaces:
RandomLongGenerator,RandomNumberGenerator,LinearCongruentialGenerator,Seedable
public class LEcuyer extends Object implements LinearCongruentialGenerator
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 modulusm = 2^31-1 = 2147483647, anda[] = {0, 63308, -183326}. The second has a modulusm = 2145483479, anda[] = {86098, 0, -539608}.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longmodulus()Get the modulus of this linear congruential generator.doublenextDouble()Get the next randomdouble.longnextLong()Get the next randomlong.intorder()Get the order of recursion.voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
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 Detail
-
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:LinearCongruentialGeneratorGet the order of recursion.- Specified by:
orderin interfaceLinearCongruentialGenerator- Returns:
- the order of recursion
-
modulus
public long modulus()
Description copied from interface:LinearCongruentialGeneratorGet the modulus of this linear congruential generator.- Specified by:
modulusin interfaceLinearCongruentialGenerator- Returns:
- the modulus
-
nextLong
public long nextLong()
Description copied from interface:RandomLongGeneratorGet the next randomlong.- Specified by:
nextLongin interfaceRandomLongGenerator- Returns:
- the next random
long
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGeneratorGet the next randomdouble.- Specified by:
nextDoublein interfaceRandomNumberGenerator- Returns:
- the next random number
-
-