From f3d957dfbe751df8c15f9435819fc62469c6ad88 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Fri, 12 Nov 2010 17:53:50 +0000 Subject: [PATCH] MATH-425 Removed deprecated "MatrixVisitorException". Modified affected files. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1034494 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/linear/AbstractFieldMatrix.java | 42 ++++++--------- .../math/linear/AbstractRealMatrix.java | 36 +++++-------- .../math/linear/Array2DRowFieldMatrix.java | 24 +++------ .../math/linear/Array2DRowRealMatrix.java | 24 +++------ .../commons/math/linear/BlockFieldMatrix.java | 28 ++++------ .../commons/math/linear/BlockRealMatrix.java | 24 +++------ .../DefaultFieldMatrixChangingVisitor.java | 3 +- .../DefaultFieldMatrixPreservingVisitor.java | 4 +- .../DefaultRealMatrixChangingVisitor.java | 3 +- .../DefaultRealMatrixPreservingVisitor.java | 4 +- .../commons/math/linear/FieldMatrix.java | 36 ++++++++----- .../linear/FieldMatrixChangingVisitor.java | 7 ++- .../linear/FieldMatrixPreservingVisitor.java | 7 ++- .../math/linear/MatrixVisitorException.java | 53 ------------------- .../commons/math/linear/RealMatrix.java | 36 ++++++++----- .../linear/RealMatrixChangingVisitor.java | 7 ++- .../linear/RealMatrixPreservingVisitor.java | 7 ++- .../ode/nonstiff/AdamsMoultonIntegrator.java | 4 +- .../math/linear/QRDecompositionImplTest.java | 3 +- .../commons/math/linear/QRSolverTest.java | 3 +- .../OLSMultipleLinearRegressionTest.java | 4 +- 21 files changed, 129 insertions(+), 230 deletions(-) delete mode 100644 src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java diff --git a/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java b/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java index 774c2433c..dbcb9811a 100644 --- a/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java @@ -730,8 +730,7 @@ public abstract class AbstractFieldMatrix> implements } /** {@inheritDoc} */ - public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -746,8 +745,7 @@ public abstract class AbstractFieldMatrix> implements } /** {@inheritDoc} */ - public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -762,8 +760,7 @@ public abstract class AbstractFieldMatrix> implements /** {@inheritDoc} */ public T walkInRowOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -779,9 +776,8 @@ public abstract class AbstractFieldMatrix> implements /** {@inheritDoc} */ public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor, - final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startRow, final int endRow, + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -794,8 +790,7 @@ public abstract class AbstractFieldMatrix> implements } /** {@inheritDoc} */ - public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -810,8 +805,7 @@ public abstract class AbstractFieldMatrix> implements } /** {@inheritDoc} */ - public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -826,8 +820,7 @@ public abstract class AbstractFieldMatrix> implements /** {@inheritDoc} */ public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -844,8 +837,7 @@ public abstract class AbstractFieldMatrix> implements /** {@inheritDoc} */ public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -858,30 +850,26 @@ public abstract class AbstractFieldMatrix> implements } /** {@inheritDoc} */ - public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor) { return walkInRowOrder(visitor); } /** {@inheritDoc} */ - public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor) { return walkInRowOrder(visitor); } /** {@inheritDoc} */ public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor, - final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startRow, final int endRow, + final int startColumn, final int endColumn) { 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) - throws MatrixVisitorException { + final int startRow, final int endRow, + final int startColumn, final int endColumn) { return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn); } diff --git a/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java b/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java index 16e166713..df4d05818 100644 --- a/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java @@ -647,8 +647,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { } /** {@inheritDoc} */ - public double walkInRowOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -663,8 +662,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { } /** {@inheritDoc} */ - public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -679,8 +677,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { /** {@inheritDoc} */ public double walkInRowOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -697,8 +694,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { /** {@inheritDoc} */ public double walkInRowOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -711,8 +707,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { } /** {@inheritDoc} */ - public double walkInColumnOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInColumnOrder(final RealMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -727,8 +722,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { } /** {@inheritDoc} */ - public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -743,8 +737,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { /** {@inheritDoc} */ public double walkInColumnOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -761,8 +754,7 @@ public abstract class AbstractRealMatrix implements RealMatrix { /** {@inheritDoc} */ public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -775,30 +767,26 @@ public abstract class AbstractRealMatrix implements RealMatrix { } /** {@inheritDoc} */ - public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) { return walkInRowOrder(visitor); } /** {@inheritDoc} */ - public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor) { return walkInRowOrder(visitor); } /** {@inheritDoc} */ public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn); } /** {@inheritDoc} */ public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn); } diff --git a/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java b/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java index 454ef0688..f47e8784f 100644 --- a/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java @@ -435,8 +435,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi /** {@inheritDoc} */ @Override - public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -451,8 +450,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi /** {@inheritDoc} */ @Override - public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -469,8 +467,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi @Override public T walkInRowOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -487,8 +484,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi @Override public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -503,8 +499,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi /** {@inheritDoc} */ @Override - public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -519,8 +514,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi /** {@inheritDoc} */ @Override - public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -536,8 +530,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi @Override public T walkInColumnOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -554,8 +547,7 @@ public class Array2DRowFieldMatrix> extends AbstractFi @Override public T walkInColumnOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); diff --git a/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java b/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java index c605acc3e..1c868352e 100644 --- a/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java @@ -385,8 +385,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ /** {@inheritDoc} */ @Override - public double walkInRowOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -401,8 +400,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ /** {@inheritDoc} */ @Override - public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -419,8 +417,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ @Override public double walkInRowOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -437,8 +434,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ @Override public double walkInRowOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -453,8 +449,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ /** {@inheritDoc} */ @Override - public double walkInColumnOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInColumnOrder(final RealMatrixChangingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -469,8 +464,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ /** {@inheritDoc} */ @Override - public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor) { final int rows = getRowDimension(); final int columns = getColumnDimension(); visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); @@ -486,8 +480,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ @Override public double walkInColumnOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); @@ -504,8 +497,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ @Override public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(getRowDimension(), getColumnDimension(), startRow, endRow, startColumn, endColumn); diff --git a/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java b/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java index 0a2bfbe32..75e3c6949 100644 --- a/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java @@ -1320,8 +1320,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override - public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; @@ -1345,8 +1344,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override - public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; @@ -1371,9 +1369,8 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override public T walkInRowOrder(final FieldMatrixChangingVisitor visitor, - final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startRow, final int endRow, + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1401,9 +1398,8 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override public T walkInRowOrder(final FieldMatrixPreservingVisitor visitor, - final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startRow, final int endRow, + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1430,8 +1426,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override - public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { @@ -1456,8 +1451,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa /** {@inheritDoc} */ @Override - public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { @@ -1484,8 +1478,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa @Override public T walkInOptimizedOrder(final FieldMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1514,8 +1507,7 @@ public class BlockFieldMatrix> extends AbstractFieldMa @Override public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { checkSubMatrixIndex(startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { diff --git a/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java b/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java index 7d973589d..031b58e42 100644 --- a/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java @@ -1304,8 +1304,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable /** {@inheritDoc} */ @Override - public double walkInRowOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; @@ -1329,8 +1328,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable /** {@inheritDoc} */ @Override - public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; @@ -1356,8 +1354,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable @Override public double walkInRowOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1386,8 +1383,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable @Override public double walkInRowOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1414,8 +1410,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable /** {@inheritDoc} */ @Override - public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) - throws MatrixVisitorException { + public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { @@ -1440,8 +1435,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable /** {@inheritDoc} */ @Override - public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor) - throws MatrixVisitorException { + public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { @@ -1468,8 +1462,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable @Override public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { @@ -1498,8 +1491,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable @Override public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, - final int startColumn, final int endColumn) - throws MatrixVisitorException { + final int startColumn, final int endColumn) { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { diff --git a/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java b/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java index 11e4b768c..45a325c34 100644 --- a/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java @@ -49,8 +49,7 @@ public class DefaultFieldMatrixChangingVisitor> } /** {@inheritDoc} */ - public T visit(int row, int column, T value) - throws MatrixVisitorException { + public T visit(int row, int column, T value) { return value; } diff --git a/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java b/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java index 53d4de1d6..e613e4fc9 100644 --- a/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java @@ -49,9 +49,7 @@ public class DefaultFieldMatrixPreservingVisitor> } /** {@inheritDoc} */ - public void visit(int row, int column, T value) - throws MatrixVisitorException { - } + public void visit(int row, int column, T value) {} /** {@inheritDoc} */ public T end() { diff --git a/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java b/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java index 3cdbc5e01..bc8cae8ec 100644 --- a/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java @@ -35,8 +35,7 @@ public class DefaultRealMatrixChangingVisitor implements RealMatrixChangingVisit } /** {@inheritDoc} */ - public double visit(int row, int column, double value) - throws MatrixVisitorException { + public double visit(int row, int column, double value) { return value; } diff --git a/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java b/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java index c701ad0ab..aea8a4627 100644 --- a/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java @@ -35,9 +35,7 @@ public class DefaultRealMatrixPreservingVisitor implements RealMatrixPreservingV } /** {@inheritDoc} */ - public void visit(int row, int column, double value) - throws MatrixVisitorException { - } + public void visit(int row, int column, double value) {} /** {@inheritDoc} */ public double end() { diff --git a/src/main/java/org/apache/commons/math/linear/FieldMatrix.java b/src/main/java/org/apache/commons/math/linear/FieldMatrix.java index 762b9511d..5d60915e5 100644 --- a/src/main/java/org/apache/commons/math/linear/FieldMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/FieldMatrix.java @@ -471,7 +471,8 @@ public interface FieldMatrix> extends AnyMatrix { * of a row from left to right before going to the leftmost element * of the next row.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixPreservingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) @@ -494,7 +495,8 @@ public interface FieldMatrix> extends AnyMatrix { * of a row from left to right before going to the leftmost element * of the next row.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixChangingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) * @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int) @@ -521,7 +523,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) @@ -551,7 +554,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) @@ -577,7 +581,8 @@ public interface FieldMatrix> extends AnyMatrix { * of a column from top to bottom before going to the topmost element * of the next column.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixChangingVisitor) * @see #walkInRowOrder(FieldMatrixPreservingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) @@ -600,7 +605,8 @@ public interface FieldMatrix> extends AnyMatrix { * of a column from top to bottom before going to the topmost element * of the next column.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixChangingVisitor) * @see #walkInRowOrder(FieldMatrixPreservingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) @@ -627,7 +633,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) @@ -657,7 +664,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) @@ -682,7 +690,8 @@ public interface FieldMatrix> extends AnyMatrix { *

The fastest walking order depends on the exact matrix class. It may be * different from traditional row or column orders.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixChangingVisitor) * @see #walkInRowOrder(FieldMatrixPreservingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) @@ -704,7 +713,8 @@ public interface FieldMatrix> extends AnyMatrix { *

The fastest walking order depends on the exact matrix class. It may be * different from traditional row or column orders.

* @param visitor visitor used to process all matrix entries - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(FieldMatrixChangingVisitor) * @see #walkInRowOrder(FieldMatrixPreservingVisitor) * @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int) @@ -730,7 +740,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index (inclusive) - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) @@ -759,7 +770,8 @@ public interface FieldMatrix> extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index (inclusive) - * @exception MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException * if the indices are not valid. * @see #walkInRowOrder(FieldMatrixChangingVisitor) diff --git a/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java b/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java index 57886b37d..bb3e1a212 100644 --- a/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java @@ -47,10 +47,10 @@ public interface FieldMatrixChangingVisitor> { * @param column column index of the entry * @param value current value of the entry * @return the new value to be set for the entry - * @throws MatrixVisitorException if something wrong occurs + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. */ - T visit(int row, int column, T value) - throws MatrixVisitorException; + T visit(int row, int column, T value); /** * End visiting a matrix. @@ -58,5 +58,4 @@ public interface FieldMatrixChangingVisitor> { * @return the value that the walkInXxxOrder must return */ T end(); - } diff --git a/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java b/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java index b408462f4..0f30fe0ad 100644 --- a/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java @@ -46,10 +46,10 @@ public interface FieldMatrixPreservingVisitor> { * @param row row index of the entry * @param column column index of the entry * @param value current value of the entry - * @throws MatrixVisitorException if something wrong occurs + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. */ - void visit(int row, int column, T value) - throws MatrixVisitorException; + void visit(int row, int column, T value); /** * End visiting a matrix. @@ -57,5 +57,4 @@ public interface FieldMatrixPreservingVisitor> { * @return the value that the walkInXxxOrder must return */ T end(); - } diff --git a/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java b/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java deleted file mode 100644 index 6d216b856..000000000 --- a/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.commons.math.linear; - -import org.apache.commons.math.MathRuntimeException; -import org.apache.commons.math.exception.util.Localizable; - -/** - * Thrown when a visitor encounters an error while processing a matrix entry. - * @version $Revision$ $Date$ - */ -public class MatrixVisitorException extends MathRuntimeException { - - /** Serializable version identifier */ - private static final long serialVersionUID = 3814333035048617048L; - - /** - * Constructs a new instance with specified formatted detail message. - * @param pattern format specifier - * @param arguments format arguments - * @deprecated as of 2.2 replaced by {@link #MatrixVisitorException(Localizable, Object...)} - */ - @Deprecated - public MatrixVisitorException(final String pattern, final Object[] arguments) { - super(pattern, arguments); - } - - /** - * Constructs a new instance with specified formatted detail message. - * @param pattern format specifier - * @param arguments format arguments - * @since 2.2 - */ - public MatrixVisitorException(final Localizable pattern, final Object[] arguments) { - super(pattern, arguments); - } - -} diff --git a/src/main/java/org/apache/commons/math/linear/RealMatrix.java b/src/main/java/org/apache/commons/math/linear/RealMatrix.java index 491dbce89..72760ad06 100644 --- a/src/main/java/org/apache/commons/math/linear/RealMatrix.java +++ b/src/main/java/org/apache/commons/math/linear/RealMatrix.java @@ -476,7 +476,8 @@ public interface RealMatrix extends AnyMatrix { * of a row from left to right before going to the leftmost element * of the next row.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixPreservingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) * @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int) @@ -499,7 +500,8 @@ public interface RealMatrix extends AnyMatrix { * of a row from left to right before going to the leftmost element * of the next row.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixChangingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) * @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int) @@ -526,7 +528,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if * the indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) @@ -556,7 +559,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if * the indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) @@ -582,7 +586,8 @@ public interface RealMatrix extends AnyMatrix { * of a column from top to bottom before going to the topmost element * of the next column.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixChangingVisitor) * @see #walkInRowOrder(RealMatrixPreservingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) @@ -605,7 +610,8 @@ public interface RealMatrix extends AnyMatrix { * of a column from top to bottom before going to the topmost element * of the next column.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixChangingVisitor) * @see #walkInRowOrder(RealMatrixPreservingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) @@ -632,7 +638,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if * the indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) @@ -662,7 +669,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if * the indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) @@ -687,7 +695,8 @@ public interface RealMatrix extends AnyMatrix { *

The fastest walking order depends on the exact matrix class. It may be * different from traditional row or column orders.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixChangingVisitor) * @see #walkInRowOrder(RealMatrixPreservingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) @@ -709,7 +718,8 @@ public interface RealMatrix extends AnyMatrix { *

The fastest walking order depends on the exact matrix class. It may be * different from traditional row or column orders.

* @param visitor visitor used to process all matrix entries - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @see #walkInRowOrder(RealMatrixChangingVisitor) * @see #walkInRowOrder(RealMatrixPreservingVisitor) * @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int) @@ -735,7 +745,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index (inclusive) - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if * the indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) @@ -764,7 +775,8 @@ public interface RealMatrix extends AnyMatrix { * @param endRow Final row index (inclusive) * @param startColumn Initial column index * @param endColumn Final column index (inclusive) - * @throws MatrixVisitorException if the visitor cannot process an entry + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. * @throws org.apache.commons.math.exception.OutOfRangeException if the * indices are not valid. * @see #walkInRowOrder(RealMatrixChangingVisitor) diff --git a/src/main/java/org/apache/commons/math/linear/RealMatrixChangingVisitor.java b/src/main/java/org/apache/commons/math/linear/RealMatrixChangingVisitor.java index 6001fddaf..f0a883db6 100644 --- a/src/main/java/org/apache/commons/math/linear/RealMatrixChangingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/RealMatrixChangingVisitor.java @@ -45,10 +45,10 @@ public interface RealMatrixChangingVisitor { * @param column column index of the entry * @param value current value of the entry * @return the new value to be set for the entry - * @throws MatrixVisitorException if something wrong occurs + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. */ - double visit(int row, int column, double value) - throws MatrixVisitorException; + double visit(int row, int column, double value); /** * End visiting a matrix. @@ -56,5 +56,4 @@ public interface RealMatrixChangingVisitor { * @return the value that the walkInXxxOrder must return */ double end(); - } diff --git a/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java b/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java index 1e4b09f0b..dfeb63aa7 100644 --- a/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java +++ b/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java @@ -44,10 +44,10 @@ public interface RealMatrixPreservingVisitor { * @param row row index of the entry * @param column column index of the entry * @param value current value of the entry - * @throws MatrixVisitorException if something wrong occurs + * @throws org.apache.commons.math.exception.MathUserException if the visitor + * cannot process an entry. */ - void visit(int row, int column, double value) - throws MatrixVisitorException; + void visit(int row, int column, double value); /** * End visiting a matrix. @@ -55,5 +55,4 @@ public interface RealMatrixPreservingVisitor { * @return the value that the walkInXxxOrder must return */ double end(); - } diff --git a/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java b/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java index 0208bc317..dcab956ed 100644 --- a/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java +++ b/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java @@ -20,7 +20,6 @@ package org.apache.commons.math.ode.nonstiff; import java.util.Arrays; import org.apache.commons.math.linear.Array2DRowRealMatrix; -import org.apache.commons.math.linear.MatrixVisitorException; import org.apache.commons.math.linear.RealMatrixPreservingVisitor; import org.apache.commons.math.ode.DerivativeException; import org.apache.commons.math.ode.FirstOrderDifferentialEquations; @@ -413,8 +412,7 @@ public class AdamsMoultonIntegrator extends AdamsIntegrator { } /** {@inheritDoc} */ - public void visit(int row, int column, double value) - throws MatrixVisitorException { + public void visit(int row, int column, double value) { if ((row & 0x1) == 0) { after[column] -= value; } else { diff --git a/src/test/java/org/apache/commons/math/linear/QRDecompositionImplTest.java b/src/test/java/org/apache/commons/math/linear/QRDecompositionImplTest.java index 27b90412a..43785e3ea 100644 --- a/src/test/java/org/apache/commons/math/linear/QRDecompositionImplTest.java +++ b/src/test/java/org/apache/commons/math/linear/QRDecompositionImplTest.java @@ -240,8 +240,7 @@ public class QRDecompositionImplTest extends TestCase { RealMatrix m = MatrixUtils.createRealMatrix(rows, columns); m.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor(){ @Override - public double visit(int row, int column, double value) - throws MatrixVisitorException { + public double visit(int row, int column, double value) { return 2.0 * r.nextDouble() - 1.0; } }); diff --git a/src/test/java/org/apache/commons/math/linear/QRSolverTest.java b/src/test/java/org/apache/commons/math/linear/QRSolverTest.java index b5ad23e97..bf645dd43 100644 --- a/src/test/java/org/apache/commons/math/linear/QRSolverTest.java +++ b/src/test/java/org/apache/commons/math/linear/QRSolverTest.java @@ -203,8 +203,7 @@ public class QRSolverTest extends TestCase { RealMatrix m = MatrixUtils.createRealMatrix(rows, columns); m.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor(){ @Override - public double visit(int row, int column, double value) - throws MatrixVisitorException { + public double visit(int row, int column, double value) { return 2.0 * r.nextDouble() - 1.0; } }); diff --git a/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java b/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java index 88739e2c3..52d9d6589 100644 --- a/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java +++ b/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java @@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals; import org.apache.commons.math.TestUtils; import org.apache.commons.math.linear.DefaultRealMatrixChangingVisitor; import org.apache.commons.math.linear.MatrixUtils; -import org.apache.commons.math.linear.MatrixVisitorException; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.linear.Array2DRowRealMatrix; import org.apache.commons.math.linear.RealVector; @@ -88,8 +87,7 @@ public class OLSMultipleLinearRegressionTest extends MultipleLinearRegressionAbs RealMatrix referenceVariance = new Array2DRowRealMatrix(s.length, s.length); referenceVariance.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override - public double visit(int row, int column, double value) - throws MatrixVisitorException { + public double visit(int row, int column, double value) { if (row == 0) { return s[column]; }