Example usage for org.apache.commons.math3.exception.util LocalizedFormats DIFFERENT_ROWS_LENGTHS

List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats DIFFERENT_ROWS_LENGTHS

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception.util LocalizedFormats DIFFERENT_ROWS_LENGTHS.

Prototype

LocalizedFormats DIFFERENT_ROWS_LENGTHS

To view the source code for org.apache.commons.math3.exception.util LocalizedFormats DIFFERENT_ROWS_LENGTHS.

Click Source Link

Usage

From source file:org.gitools.analysis.groupcomparison.format.math33Preview.MathArrays.java

/**
 * Throws DimensionMismatchException if the input array is not rectangular.
 *
 * @param in array to be tested//from   w  w w  .j  ava2 s. com
 * @throws NullArgumentException      if input array is null
 * @throws DimensionMismatchException if input array is not rectangular
 * @since 3.1
 */
public static void checkRectangular(final long[][] in)
        throws NullArgumentException, DimensionMismatchException {
    MathUtils.checkNotNull(in);
    for (int i = 1; i < in.length; i++) {
        if (in[i].length != in[0].length) {
            throw new DimensionMismatchException(LocalizedFormats.DIFFERENT_ROWS_LENGTHS, in[i].length,
                    in[0].length);
        }
    }
}