|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.math.Factorial
public class Factorial
Defines methods for factorials.
Field Summary | |
---|---|
protected static double[] |
doubleFactorials
|
protected static long[] |
longFactorials
|
Constructor Summary | |
---|---|
Factorial()
|
Method Summary | |
---|---|
static double |
factorial(int n)
Compute factorial of an integer. |
static double |
logFactorial(int n)
Computes the natural log of n factorial. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final long[] longFactorials
protected static final double[] doubleFactorials
Constructor Detail |
---|
public Factorial()
Method Detail |
---|
public static double factorial(int n)
n
- Number for which to compute factorial.
public static double logFactorial(int n)
n
- The number for which the log factorial is desired.
We use the LogGamma function to compute log(n!) using the relation:
log(n!) = logGamma( n + 1 )
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |