|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mark.core.math.Util
Util is a class that contains a number of simple static utility methods.
| Constructor Summary | |
Util()
|
|
| Method Summary | |
static double |
constrain(double d,
double min,
double max)
Constrains a double. |
static boolean |
equals(double[][][] lhs,
double[][][] rhs)
Returns whether two double[][][]'s are equal. |
static boolean |
equals(double[][] lhs,
double[][] rhs)
Returns whether two double[][]'s are equal. |
static void |
fill(double[][][] a,
double val)
Fills a double[][][] with the given value. |
static void |
fill(double[][] a,
double val)
Fills a double[][] with the given value. |
static double |
log2(double a)
Calculates the log base 2 of its argument. |
static void |
normalize(double[] a)
Normalizes the components of a double[] to sum to 1.0. |
static double |
pointwiseChiSquared(double numX1X2,
double numX1,
double numX2,
double num)
Returns the pointwise chi-squared value of (X1, X2). |
static int |
random(java.util.Random gen,
int low,
int high)
Returns a random int in the given range (inclusive). |
static double |
sum(double[] a)
Returns the sum of a double[]. |
static double |
sum(double[][] a)
Returns the sum of a double[][]. |
static double |
sum(double[][][] a)
Returns the sum of a double[][][]. |
static double |
weightedPointwiseMutualInformation(double numX1X2,
double numX1,
double numX2,
double num)
Returns the weighted pointwise mutual information of (X1 = x1, X2 = x2). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Util()
| Method Detail |
public static void fill(double[][] a,
double val)
a - the array.val - the value.
public static void fill(double[][][] a,
double val)
a - the array.val - the value.public static double sum(double[] a)
a - the array.
public static double sum(double[][] a)
a - the array.
public static double sum(double[][][] a)
a - the array.
public static void normalize(double[] a)
a - the array.
public static boolean equals(double[][] lhs,
double[][] rhs)
lhs - the first array.rhs - the second array.
public static boolean equals(double[][][] lhs,
double[][][] rhs)
lhs - the first array.rhs - the second array.
public static int random(java.util.Random gen,
int low,
int high)
low - the start of the range.high - the end of the range.
public static double constrain(double d,
double min,
double max)
d - the double.min - the smallest value in the range.max - the largest value in the range.
public static double log2(double a)
a - the argument
public static double weightedPointwiseMutualInformation(double numX1X2,
double numX1,
double numX2,
double num)
numX1X2 - #(X1 = x1, X2 = x2).numX1 - #(X1 = x1).numX2 - #(X2 = x2).num - the total number of samples.
public static double pointwiseChiSquared(double numX1X2,
double numX1,
double numX2,
double num)
numX1X2 - #(X1 = x1, X2 = x2).numX1 - #(X1 = x1).numX2 - #(X2 = x2).num - the total number of samples.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||