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

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

Introduction

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

Prototype

LocalizedFormats INSUFFICIENT_ROWS_AND_COLUMNS

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

Click Source Link

Usage

From source file:Rotationforest.Covariance.java

/**
 * Throws MathIllegalArgumentException if the matrix does not have at least
 * one column and two rows.//from   www . j a va 2  s.c o  m
 * @param matrix matrix to check
 * @throws MathIllegalArgumentException if the matrix does not contain sufficient data
 * to compute covariance
 */
private void checkSufficientData(final RealMatrix matrix) throws MathIllegalArgumentException {
    int nRows = matrix.getRowDimension();
    int nCols = matrix.getColumnDimension();
    if (nRows < 2 || nCols < 1) {
        throw new MathIllegalArgumentException(LocalizedFormats.INSUFFICIENT_ROWS_AND_COLUMNS, nRows, nCols);
    }
}