Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#ARRAY_ELEMENT

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#ARRAY_ELEMENT . 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: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 2
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 3
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val) {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 4
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 5
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val) {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 6
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 7
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}
 
Example 8
Source File: MathUtils.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that all the elements are real numbers.
 *
 * @param val Arguments.
 * @throws NotFiniteNumberException if any values of the array is not a
 * finite real number.
 */
public static void checkFinite(final double[] val)
    throws NotFiniteNumberException {
    for (int i = 0; i < val.length; i++) {
        final double x = val[i];
        if (Double.isInfinite(x) || Double.isNaN(x)) {
            throw new NotFiniteNumberException(LocalizedFormats.ARRAY_ELEMENT, x, i);
        }
    }
}