| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long[] | FACTORIALS
All long-representable factorials |
| pack-priv static final AtomicReference | STIRLING_S2
Stirling numbers of the second kind. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static long | Returns: n choose kthe size of the set n, final int the size of the subsets to be counted k)Returns an exact representation of the Binomial
Coefficient, " |
| public static double | Returns: n choose kthe size of the set n, final int the size of the subsets to be counted k)Returns a |
| public static double | Returns: n choose kthe size of the set n, final int the size of the subsets to be counted k)Returns the natural |
| public static void | checkBinomial(final int
Size of the set. n, final int Size of the subsets to be counted. k)Check binomial preconditions. |
| public static Iterator | Returns: aniterator over the k-sets in n.Size of the set from which subsets are selected. n, int Size of the subsets to be enumerated. k)Returns an iterator whose range is the k-element subsets of {0, ..., n - 1}
represented as |
| public static long | |
| public static double | Returns: n!Argument. n)Compute n!, the
factorial of |
| public static double | |
| public static long | Returns: S(n,k)the size of the set n, final int the number of non-empty subsets k)Returns the
Stirling number of the second kind, " |
| FACTORIALS | back to summary |
|---|---|
| pack-priv static final long[] FACTORIALS All long-representable factorials | |
| STIRLING_S2 | back to summary |
|---|---|
| pack-priv static final AtomicReference<long[][]> STIRLING_S2 Stirling numbers of the second kind. | |
| CombinatoricsUtils | back to summary |
|---|---|
| private CombinatoricsUtils() Private constructor (class contains only static methods). | |
| binomialCoefficient | back to summary |
|---|---|
| public static long binomialCoefficient(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException Returns an exact representation of the Binomial
Coefficient, " Preconditions:
| |
| binomialCoefficientDouble | back to summary |
|---|---|
| public static double binomialCoefficientDouble(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException Returns a Preconditions:
| |
| binomialCoefficientLog | back to summary |
|---|---|
| public static double binomialCoefficientLog(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException Returns the natural Preconditions:
| |
| checkBinomial | back to summary |
|---|---|
| public static void checkBinomial(final int n, final int k) throws NumberIsTooLargeException, NotPositiveException Check binomial preconditions.
| |
| combinationsIterator | back to summary |
|---|---|
| public static Iterator Returns an iterator whose range is the k-element subsets of {0, ..., n - 1}
represented as
The arrays returned by the iterator are sorted in descending order and
they are visited in lexicographic order with significance from right to
left. For example, combinationsIterator(4, 2) returns an Iterator that
will generate the following sequence of arrays on successive calls to
If
| |
| factorial | back to summary |
|---|---|
| public static long factorial(final int n) throws NotPositiveException, MathArithmeticException Returns n!. Shorthand for Preconditions:
| |
| factorialDouble | back to summary |
|---|---|
| public static double factorialDouble(final int n) throws NotPositiveException Compute n!, the
factorial of
| |
| factorialLog | back to summary |
|---|---|
| public static double factorialLog(final int n) throws NotPositiveException Compute the natural logarithm of the factorial of
| |
| stirlingS2 | back to summary |
|---|---|
| public static long stirlingS2(final int n, final int k) throws NotPositiveException, NumberIsTooLargeException, MathArithmeticException Returns the
Stirling number of the second kind, "
The preconditions are
| |