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

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#EMPTY_SELECTED_COLUMN_INDEX_ARRAY . 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: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 2
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 3
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns) {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 4
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 5
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns) {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 6
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 7
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}
 
Example 8
Source File: MatrixUtils.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check if submatrix ranges indices are valid.
 * Rows and columns are indicated counting from 0 to n-1.
 *
 * @param m Matrix.
 * @param selectedRows Array of row indices.
 * @param selectedColumns Array of column indices.
 * @throws NullArgumentException if {@code selectedRows} or
 * {@code selectedColumns} are {@code null}.
 * @throws NoDataException if the row or column selections are empty (zero
 * length).
 * @throws OutOfRangeException if row or column selections are not valid.
 */
public static void checkSubMatrixIndex(final AnyMatrix m,
                                       final int[] selectedRows,
                                       final int[] selectedColumns)
    throws NoDataException, NullArgumentException, OutOfRangeException {
    if (selectedRows == null) {
        throw new NullArgumentException();
    }
    if (selectedColumns == null) {
        throw new NullArgumentException();
    }
    if (selectedRows.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_ROW_INDEX_ARRAY);
    }
    if (selectedColumns.length == 0) {
        throw new NoDataException(LocalizedFormats.EMPTY_SELECTED_COLUMN_INDEX_ARRAY);
    }

    for (final int row : selectedRows) {
        checkRowIndex(m, row);
    }
    for (final int column : selectedColumns) {
        checkColumnIndex(m, column);
    }
}