java.lang.Object org.apache.mahout.collections.Constants org.apache.mahout.collections.ArithmeticArithmetic functions.
|Fields inherited from org.apache.mahout.collections.Constants:|
|MACHEP, MAXLOG, MINLOG, MAXGAM, SQTPI, SQRTH, LOGPI, big, biginv|
|Method from org.apache.mahout.collections.Arithmetic Summary:|
|binomial, binomial, ceil, chbevl, floor, log, log10, log2, logFactorial, longFactorial, stirlingCorrection|
|Methods from java.lang.Object:|
|clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from org.apache.mahout.collections.Arithmetic Detail:|
public static double binomial(double n, long k)
public static double binomial(long n, long k)
public static long ceil(double value)
public static double chbevl(double x, double coef, int N) throws ArithmeticException
N-1 - ' y = > coef[i] T (x/2) - i i=0Coefficients are stored in reverse order, i.e. the zero order term is last in the array. Note N is the number of coefficients, not the order.
If coefficients are for the interval a to b, x must have been transformed to x -> 2(2x - b - a)/(b-a) before entering the routine. This maps x from (a, b) to (-1, 1), over which the Chebyshev polynomials are defined.
If the coefficients are for the inverted interval, in which (a, b) is mapped to (1/b, 1/a), the transformation required is x -> 2(2ab/x - b - a)/(b-a). If b is infinity, this becomes x -> 4a/x - 1.
Taking advantage of the recurrence properties of the Chebyshev polynomials, the routine requires one more addition per loop than evaluating a nested polynomial of the same degree.
public static long floor(double value)
public static double log(double base, double value)
public static double log10(double value)
public static double log2(double value)
public static double logFactorial(int k)
public static long longFactorial(int k) throws IllegalArgumentException
public static double stirlingCorrection(int k)
Correction term of the Stirling approximation for log(k!) (series in 1/k, or table values for small k) with int parameter k.
log k! = (k + 1/2)log(k + 1) - (k + 1) + (1/2)log(2Pi) + stirlingCorrection(k + 1)
log k! = (k + 1/2)log(k) - k + (1/2)log(2Pi) + stirlingCorrection(k)