Class BaseRandomAlgorithm

java.lang.Object
llnl.gnem.core.util.randomNumbers.BaseRandomAlgorithm
All Implemented Interfaces:
RandomAlgorithm
Direct Known Subclasses:
SimpleRandom

public abstract class BaseRandomAlgorithm extends Object implements RandomAlgorithm
Author:
dodge1
  • Constructor Details

    • BaseRandomAlgorithm

      public BaseRandomAlgorithm()
  • Method Details

    • nextDouble

      public abstract double nextDouble()
      Specified by:
      nextDouble in interface RandomAlgorithm
    • nextInt

      public abstract int nextInt()
      Specified by:
      nextInt in interface RandomAlgorithm
    • nextInt

      public abstract int nextInt(int n)
      Specified by:
      nextInt in interface RandomAlgorithm
    • nextLong

      public abstract long nextLong()
      Specified by:
      nextLong in interface RandomAlgorithm
    • getBoundedInt

      public int getBoundedInt(int lower, int upper)
      Specified by:
      getBoundedInt in interface RandomAlgorithm
    • getBoundedDouble

      public double getBoundedDouble(double lower, double upper)
      Specified by:
      getBoundedDouble in interface RandomAlgorithm
    • nextGaussian

      public double nextGaussian(double mean, double std)
      Produce a normally-distributed deviate using Box-Muller transformation. Adapted from Numerical Recipes P. 203
      Specified by:
      nextGaussian in interface RandomAlgorithm
      Parameters:
      mean -
      std -
      Returns:
      normal deviate