Class UniformRNG

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

public class UniformRNG extends Object implements RandomLongGenerator
A pseudo uniform random number generator samples numbers from the unit interval, [0, 1], in such a way that there are equal probabilities of them falling in any same length sub-interval. Sampling from the unit interval is the most basic building block of most pseudo random number generation algorithms.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    the pseudo uniform random number generators available
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a pseudo uniform random number generator.
    UniformRNG(long... seeds)
    Construct a seeded pseudo uniform random number generator.
    Construct a pseudo uniform random number generator.
  • 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

    • UniformRNG

      public UniformRNG(UniformRNG.Method method)
      Construct a pseudo uniform random number generator.
      Parameters:
      method - the uniform random number generation algorithm to use
    • UniformRNG

      public UniformRNG()
      Construct a pseudo uniform random number generator.
    • UniformRNG

      public UniformRNG(long... seeds)
      Construct a seeded pseudo uniform random number generator.
      Parameters:
      seeds - the seed(s)
  • 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
    • 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
    • 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