Class BaseRandomAlgorithm
java.lang.Object
llnl.gnem.core.util.randomNumbers.BaseRandomAlgorithm
- All Implemented Interfaces:
RandomAlgorithm
- Direct Known Subclasses:
SimpleRandom
- Author:
- dodge1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetBoundedDouble(double lower, double upper) intgetBoundedInt(int lower, int upper) abstract doubledoublenextGaussian(double mean, double std) Produce a normally-distributed deviate using Box-Muller transformation.abstract intnextInt()abstract intnextInt(int n) abstract longnextLong()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface llnl.gnem.core.util.randomNumbers.RandomAlgorithm
resetSeed
-
Constructor Details
-
BaseRandomAlgorithm
public BaseRandomAlgorithm()
-
-
Method Details
-
nextDouble
public abstract double nextDouble()- Specified by:
nextDoublein interfaceRandomAlgorithm
-
nextInt
public abstract int nextInt()- Specified by:
nextIntin interfaceRandomAlgorithm
-
nextInt
public abstract int nextInt(int n) - Specified by:
nextIntin interfaceRandomAlgorithm
-
nextLong
public abstract long nextLong()- Specified by:
nextLongin interfaceRandomAlgorithm
-
getBoundedInt
public int getBoundedInt(int lower, int upper) - Specified by:
getBoundedIntin interfaceRandomAlgorithm
-
getBoundedDouble
public double getBoundedDouble(double lower, double upper) - Specified by:
getBoundedDoublein interfaceRandomAlgorithm
-
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:
nextGaussianin interfaceRandomAlgorithm- Parameters:
mean-std-- Returns:
- normal deviate
-