/** * 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, * throwing IllegalArgumentException if any of these checks fail. * * @param in input 2-way table to check * @throws IllegalArgumentException if the array is not valid */ private void checkArray(long[][] in) throws IllegalArgumentException { if (in.length < 2) { throw MathRuntimeException.createIllegalArgumentException( LocalizedFormats.INSUFFICIENT_DIMENSION, in.length, 2); } if (in[0].length < 2) { throw MathRuntimeException.createIllegalArgumentException( LocalizedFormats.INSUFFICIENT_DIMENSION, in[0].length, 2); } checkRectangular(in); checkNonNegative(in); }
/** * 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, * throwing IllegalArgumentException if any of these checks fail. * * @param in input 2-way table to check * @throws IllegalArgumentException if the array is not valid */ private void checkArray(long[][] in) throws IllegalArgumentException { if (in.length < 2) { throw MathRuntimeException.createIllegalArgumentException( "invalid row dimension: {0} (must be at least 2)", in.length); } if (in[0].length < 2) { throw MathRuntimeException.createIllegalArgumentException( "invalid column dimension: {0} (must be at least 2)", in[0].length); } checkRectangular(in); checkNonNegative(in); }