public class MathUtils
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static MersenneTwisterFast |
random |
A random number generator that is initialized with the clock when this
class is loaded into the JVM.
|
Constructor | Description |
---|---|
MathUtils() |
Modifier and Type | Method | Description |
---|---|---|
static double |
ensureBounded(double x,
double lower,
double upper) |
Ensure a value of x is actaully bounded between two values.
|
static double |
getLoggedDifferenceFromLogged(double lnOfX,
double lnOfY) |
Calculate the logged difference in two values = x - y, where the log of x and y are given.
|
static double |
getMaximum(double[] array) |
|
static double |
getMaximum(double[] array,
int start,
int end) |
|
static double |
getMinimum(double[] array) |
|
static double |
getMinimum(double[] array,
int start,
int end) |
|
static double[] |
getNormalized(double[] array) |
|
static double[] |
getRandomArguments(MultivariateFunction mf) |
|
static double |
getTotal(double[] array) |
|
static double |
getTotal(double[] array,
int start,
int end) |
public static MersenneTwisterFast random
public static final double getLoggedDifferenceFromLogged(double lnOfX, double lnOfY)
lnOfX
- the natural log of XlnOfY
- the natural log of Ypublic static final double ensureBounded(double x, double lower, double upper)
x
- the value of interestlower
- the lower boundupper
- the upper boundpublic static final double[] getNormalized(double[] array)
public static final double getTotal(double[] array, int start, int end)
end
- the index of the element after the last one to be includedpublic static final double getMinimum(double[] array, int start, int end)
array
- start
- end
- the index of the element after the last one to be includedpublic static final double getMinimum(double[] array)
array
- The array of values to examinepublic static final double getMaximum(double[] array)
array
- The array of values to examinepublic static final double getMaximum(double[] array, int start, int end)
array
- start
- end
- the index of the element after the last one to be includedpublic static final double getTotal(double[] array)
public static final double[] getRandomArguments(MultivariateFunction mf)