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 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
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    long
    Get the modulus of this linear congruential generator.
    double
    Get the next random double.
    long
    Get the next random long.
    int
    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 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 seed
      seed12 - a seed
      seed13 - a seed
      seed21 - a seed
      seed22 - a seed
      seed23 - 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.

      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