edu.cmu.minorthird.classify.algorithms.random
Class Arithmetic
java.lang.Object
edu.cmu.minorthird.classify.algorithms.random.Constants
edu.cmu.minorthird.classify.algorithms.random.Arithmetic
public class Arithmetic
- extends Constants
Method Summary |
static double |
binomial(double n,
long k)
|
static double |
binomial(long n,
long k)
|
static long |
ceil(double value)
|
static double |
chbevl(double x,
double[] coef,
int N)
|
static double |
factorial(int k)
|
static long |
floor(double value)
|
static double |
log(double base,
double value)
|
static double |
log10(double value)
|
static double |
log2(double value)
|
static double |
logFactorial(int k)
|
static double |
logGamma(double x)
Returns the log of Gamma(double x), using Algorithm 291. |
static long |
longFactorial(int k)
|
static double |
stirlingCorrection(int k)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logFactorials
protected static final double[] logFactorials
longFactorials
protected static final long[] longFactorials
doubleFactorials
protected static final double[] doubleFactorials
Arithmetic
protected Arithmetic()
binomial
public static double binomial(double n,
long k)
binomial
public static double binomial(long n,
long k)
ceil
public static long ceil(double value)
chbevl
public static double chbevl(double x,
double[] coef,
int N)
throws java.lang.ArithmeticException
- Throws:
java.lang.ArithmeticException
factorial
public static double factorial(int k)
floor
public static long floor(double value)
log
public static double log(double base,
double value)
log10
public static double log10(double value)
log2
public static double log2(double value)
logFactorial
public static double logFactorial(int k)
longFactorial
public static long longFactorial(int k)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
stirlingCorrection
public static double stirlingCorrection(int k)
logGamma
public static double logGamma(double x)
- Returns the log of Gamma(double x), using Algorithm 291. Pike and Hill (1966)
Uses StirlingCorrection for (double) x >= 7.