java.lang.Object
dev.nm.stat.random.rng.univariate.uniform.MWC8222
All Implemented Interfaces:
RandomLongGenerator, RandomNumberGenerator, Seedable

public class MWC8222 extends Object implements RandomLongGenerator
Marsaglia's MWC256 (also known as MWC8222) is a multiply-with-carry generator. It has a period of 2^8222 and fares well in tests of randomness. It is also extremely fast, between 2 and 3 times faster than the Mersenne Twister.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a random number generator to sample uniformly from [0, 1].
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the next random double.
    long
    Get the next random long.
    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

    • MWC8222

      public MWC8222()
      Construct a random number generator to sample uniformly from [0, 1].
  • Method Details

    • seed

      public void seed(long... seeds)
      Description copied from interface: Seedable
      Seed the random number/vector/scenario generator to produce repeatable experiments.
      Specified by:
      seed in interface Seedable
      Parameters:
      seeds - the seeds
    • 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