diff --git a/src/main/java/org/apache/commons/math3/linear/AbstractFieldMatrix.java b/src/main/java/org/apache/commons/math3/linear/AbstractFieldMatrix.java index 95a2718e9..8044451cf 100644 --- a/src/main/java/org/apache/commons/math3/linear/AbstractFieldMatrix.java +++ b/src/main/java/org/apache/commons/math3/linear/AbstractFieldMatrix.java @@ -512,7 +512,7 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public void setRowMatrix(final int row, final FieldMatrix matrix) - throws OutOfRangeException { + throws OutOfRangeException, MatrixDimensionMismatchException { checkRowIndex(row); final int nCols = getColumnDimension(); if ((matrix.getRowDimension() != 1) || @@ -544,7 +544,7 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public void setColumnMatrix(final int column, final FieldMatrix matrix) - throws OutOfRangeException { + throws OutOfRangeException, MatrixDimensionMismatchException { checkColumnIndex(column); final int nRows = getRowDimension(); if ((matrix.getRowDimension() != nRows) || @@ -560,13 +560,14 @@ public abstract class AbstractFieldMatrix> } /** {@inheritDoc} */ - public FieldVector getRowVector(final int row) { + public FieldVector getRowVector(final int row) + throws OutOfRangeException { return new ArrayFieldVector(field, getRow(row), false); } /** {@inheritDoc} */ public void setRowVector(final int row, final FieldVector vector) - throws OutOfRangeException { + throws OutOfRangeException, MatrixDimensionMismatchException { checkRowIndex(row); final int nCols = getColumnDimension(); if (vector.getDimension() != nCols) { @@ -580,13 +581,14 @@ public abstract class AbstractFieldMatrix> } /** {@inheritDoc} */ - public FieldVector getColumnVector(final int column) { + public FieldVector getColumnVector(final int column) + throws OutOfRangeException { return new ArrayFieldVector(field, getColumn(column), false); } /** {@inheritDoc} */ public void setColumnVector(final int column, final FieldVector vector) - throws OutOfRangeException { + throws OutOfRangeException, MatrixDimensionMismatchException { checkColumnIndex(column); final int nRows = getRowDimension(); @@ -614,7 +616,8 @@ public abstract class AbstractFieldMatrix> } /** {@inheritDoc} */ - public void setRow(final int row, final T[] array) throws OutOfRangeException { + public void setRow(final int row, final T[] array) + throws OutOfRangeException, MatrixDimensionMismatchException { checkRowIndex(row); final int nCols = getColumnDimension(); if (array.length != nCols) { @@ -641,7 +644,7 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public void setColumn(final int column, final T[] array) - throws OutOfRangeException { + throws OutOfRangeException, MatrixDimensionMismatchException { checkColumnIndex(column); final int nRows = getRowDimension(); if (array.length != nRows) { @@ -828,7 +831,8 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public T walkInRowOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) { + final int startColumn, final int endColumn) + throws NumberIsTooSmallException, OutOfRangeException { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -845,7 +849,8 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) { + final int startColumn, final int endColumn) + throws NumberIsTooSmallException, OutOfRangeException { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -932,14 +937,16 @@ public abstract class AbstractFieldMatrix> /** {@inheritDoc} */ public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) { + final int startColumn, final int endColumn) + throws NumberIsTooSmallException, OutOfRangeException { return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn); } /** {@inheritDoc} */ public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) { + final int startColumn, final int endColumn) + throws NumberIsTooSmallException, OutOfRangeException { return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn); }