SuanShu, a Java numerical and statistical library



com.numericalmethod.suanshu.stats.random.univariate.uniform.linear
Class LEcuyer

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.random.univariate.uniform.linear.LEcuyer
All Implemented Interfaces:
Seedable, RandomLongGenerator, RandomNumberGenerator, LinearCongruentialGenerator

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 modulus m = 2^31-1 = 2147483647, and a[] = {0, 63308, -183326}. The second has a modulus m = 2145483479, and a[] = {86098, 0, -539608}.

See Also:
"P. L'Ecuyer, "Combined multiple recursive random number generators," Operations Research 44:816-822, 1996."

Constructor Summary
LEcuyer()
          Construct a LEcuyer pseudo uniform random generator.
LEcuyer(long seed11, long seed12, long seed13, long seed21, long seed22, long seed23)
          Construct a LEcuyer pseudo uniform random generator and then seed.
 
Method Summary
 long modulus()
          Get the modulus of this linear congruential generator.
 double nextDouble()
          Get the next random double.
 long nextLong()
          Get the next random long.
 int order()
          Get the order of recursion.
 void seed(long... seeds)
          Seed the random number/vector/scenario generator to produce repeatable experiments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 seed
seed12 - a seed
seed13 - a seed
seed21 - a seed
seed22 - a seed
seed23 - 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.

Specified by:
seed in interface Seedable
Parameters:
seeds - an array of seeds

order

public int order()
Description copied from interface: LinearCongruentialGenerator
Get the order of recursion.

Specified by:
order in interface LinearCongruentialGenerator
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 interface LinearCongruentialGenerator
Returns:
the modulus

nextLong

public long nextLong()
Description copied from interface: RandomLongGenerator
Get the next random long.

Specified by:
nextLong in interface RandomLongGenerator
Returns:
the next random long

nextDouble

public double nextDouble()
Description copied from interface: RandomNumberGenerator
Get the next random double.

Specified by:
nextDouble in interface RandomNumberGenerator
Returns:
the next random number


Copyright © 2010-2014 Numerical Method Incorporation Limited. All Rights Reserved.