List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats BINOMIAL_NEGATIVE_PARAMETER
LocalizedFormats BINOMIAL_NEGATIVE_PARAMETER
To view the source code for org.apache.commons.math3.exception.util LocalizedFormats BINOMIAL_NEGATIVE_PARAMETER.
Click Source Link
From source file:org.gitools.analysis.groupcomparison.format.math33Preview.CombinatoricsUtils.java
/** * Check binomial preconditions.//from www. ja v a 2s. c o m * * @param n Size of the set. * @param k Size of the subsets to be counted. * @throws NotPositiveException if {@code n < 0}. * @throws NumberIsTooLargeException if {@code k > n}. */ public static void checkBinomial(final int n, final int k) throws NumberIsTooLargeException, NotPositiveException { if (n < k) { throw new NumberIsTooLargeException(LocalizedFormats.BINOMIAL_INVALID_PARAMETERS_ORDER, k, n, true); } if (n < 0) { throw new NotPositiveException(LocalizedFormats.BINOMIAL_NEGATIVE_PARAMETER, n); } }