Java Code Examples for org.apache.commons.math3.util.MathArrays#checkRectangular()

The following examples show how to use org.apache.commons.math3.util.MathArrays#checkRectangular() . 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: ChiSquareTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks to make sure that the input long[][] array is rectangular,
 * has at least 2 rows and 2 columns, and has all non-negative entries.
 *
 * @param in input 2-way table to check
 * @throws NullArgumentException if the array is null
 * @throws DimensionMismatchException if the array is not valid
 * @throws NotPositiveException if the array contains any negative entries
 */
private void checkArray(final long[][] in)
    throws NullArgumentException, DimensionMismatchException,
    NotPositiveException {

    if (in.length < 2) {
        throw new DimensionMismatchException(in.length, 2);
    }

    if (in[0].length < 2) {
        throw new DimensionMismatchException(in[0].length, 2);
    }

    MathArrays.checkRectangular(in);
    MathArrays.checkNonNegative(in);

}
 
Example 2
Source File: ChiSquareTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks to make sure that the input long[][] array is rectangular,
 * has at least 2 rows and 2 columns, and has all non-negative entries.
 *
 * @param in input 2-way table to check
 * @throws NullArgumentException if the array is null
 * @throws DimensionMismatchException if the array is not valid
 * @throws NotPositiveException if the array contains any negative entries
 */
private void checkArray(final long[][] in)
    throws NullArgumentException, DimensionMismatchException,
    NotPositiveException {

    if (in.length < 2) {
        throw new DimensionMismatchException(in.length, 2);
    }

    if (in[0].length < 2) {
        throw new DimensionMismatchException(in[0].length, 2);
    }

    MathArrays.checkRectangular(in);
    MathArrays.checkNonNegative(in);

}
 
Example 3
Source File: ChiSquareTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks to make sure that the input long[][] array is rectangular,
 * has at least 2 rows and 2 columns, and has all non-negative entries.
 *
 * @param in input 2-way table to check
 * @throws NullArgumentException if the array is null
 * @throws DimensionMismatchException if the array is not valid
 * @throws NotPositiveException if the array contains any negative entries
 */
private void checkArray(final long[][] in)
    throws NullArgumentException, DimensionMismatchException,
    NotPositiveException {

    if (in.length < 2) {
        throw new DimensionMismatchException(in.length, 2);
    }

    if (in[0].length < 2) {
        throw new DimensionMismatchException(in[0].length, 2);
    }

    MathArrays.checkRectangular(in);
    MathArrays.checkNonNegative(in);

}
 
Example 4
Source File: ChiSquareTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks to make sure that the input long[][] array is rectangular,
 * has at least 2 rows and 2 columns, and has all non-negative entries.
 *
 * @param in input 2-way table to check
 * @throws NullArgumentException if the array is null
 * @throws DimensionMismatchException if the array is not valid
 * @throws NotPositiveException if the array contains any negative entries
 */
private void checkArray(final long[][] in)
    throws NullArgumentException, DimensionMismatchException,
    NotPositiveException {

    if (in.length < 2) {
        throw new DimensionMismatchException(in.length, 2);
    }

    if (in[0].length < 2) {
        throw new DimensionMismatchException(in[0].length, 2);
    }

    MathArrays.checkRectangular(in);
    MathArrays.checkNonNegative(in);

}
 
Example 5
Source File: ChiSquareTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks to make sure that the input long[][] array is rectangular,
 * has at least 2 rows and 2 columns, and has all non-negative entries.
 *
 * @param in input 2-way table to check
 * @throws NullArgumentException if the array is null
 * @throws DimensionMismatchException if the array is not valid
 * @throws NotPositiveException if the array contains any negative entries
 */
private void checkArray(final long[][] in)
    throws NullArgumentException, DimensionMismatchException,
    NotPositiveException {

    if (in.length < 2) {
        throw new DimensionMismatchException(in.length, 2);
    }

    if (in[0].length < 2) {
        throw new DimensionMismatchException(in[0].length, 2);
    }

    MathArrays.checkRectangular(in);
    MathArrays.checkNonNegative(in);

}