Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#NOT_POSITIVE_ELEMENT_AT_INDEX

The following examples show how to use org.apache.commons.math.exception.util.LocalizedFormats#NOT_POSITIVE_ELEMENT_AT_INDEX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check all entries of the input array are strictly positive.
 *
 * @param in Array to be tested.
 * @exception MathIllegalArgumentException if one entry is not positive.
 */
private void checkPositive(double[] in) {
    for (int i = 0; i < in.length; i++) {
        if (in[i] <= 0) {
            throw new MathIllegalArgumentException(
                    LocalizedFormats.NOT_POSITIVE_ELEMENT_AT_INDEX,
                    i, in[i]);
        }
    }
}
 
Example 2
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check all entries of the input array are strictly positive.
 *
 * @param in Array to be tested.
 * @exception MathIllegalArgumentException if one entry is not positive.
 */
private void checkPositive(double[] in) {
    for (int i = 0; i < in.length; i++) {
        if (in[i] <= 0) {
            throw new MathIllegalArgumentException(
                    LocalizedFormats.NOT_POSITIVE_ELEMENT_AT_INDEX,
                    i, in[i]);
        }
    }
}