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