edu.cmu.minorthird.classify.algorithms.random
Class Arithmetic

java.lang.Object
  extended by edu.cmu.minorthird.classify.algorithms.random.Constants
      extended by edu.cmu.minorthird.classify.algorithms.random.Arithmetic

public class Arithmetic
extends Constants


Field Summary
protected static double[] doubleFactorials
           
protected static double[] logFactorials
           
protected static long[] longFactorials
           
 
Fields inherited from class edu.cmu.minorthird.classify.algorithms.random.Constants
big, biginv, LOGPI, MACHEP, MAXGAM, MAXLOG, MINLOG, SQRTH, SQTPI
 
Constructor Summary
protected Arithmetic()
           
 
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
 

Field Detail

logFactorials

protected static final double[] logFactorials

longFactorials

protected static final long[] longFactorials

doubleFactorials

protected static final double[] doubleFactorials
Constructor Detail

Arithmetic

protected Arithmetic()
Method Detail

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.