diff --git a/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java b/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java index da2c983a9..881e11833 100644 --- a/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java +++ b/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java @@ -957,4 +957,24 @@ public abstract class AbstractRealMatrix } return ret; } + + + /* + * Empty implementations of these methods are provided in order to allow for + * the use of the @Override tag with Java 1.5. + */ + + /** {@inheritDoc} */ + public abstract RealMatrix createMatrix(int rowDimension, int columnDimension) + throws NotStrictlyPositiveException; + + /** {@inheritDoc} */ + public abstract RealMatrix copy(); + + /** {@inheritDoc} */ + public abstract double getEntry(int row, int column) + throws OutOfRangeException; + + /** {@inheritDoc} */ + public abstract void setEntry(int row, int column, double value); } diff --git a/src/main/java/org/apache/commons/math3/linear/Array2DRowRealMatrix.java b/src/main/java/org/apache/commons/math3/linear/Array2DRowRealMatrix.java index 436db7ac7..223fe95c3 100644 --- a/src/main/java/org/apache/commons/math3/linear/Array2DRowRealMatrix.java +++ b/src/main/java/org/apache/commons/math3/linear/Array2DRowRealMatrix.java @@ -138,6 +138,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ } /** {@inheritDoc} */ + @Override public RealMatrix createMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException { @@ -145,6 +146,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ } /** {@inheritDoc} */ + @Override public RealMatrix copy() { return new Array2DRowRealMatrix(copyOut(), false); } @@ -298,6 +300,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ } /** {@inheritDoc} */ + @Override public double getEntry(final int row, final int column) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); @@ -305,6 +308,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ } /** {@inheritDoc} */ + @Override public void setEntry(final int row, final int column, final double value) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); diff --git a/src/main/java/org/apache/commons/math3/linear/BlockRealMatrix.java b/src/main/java/org/apache/commons/math3/linear/BlockRealMatrix.java index a40950ef8..04ba0b2e0 100644 --- a/src/main/java/org/apache/commons/math3/linear/BlockRealMatrix.java +++ b/src/main/java/org/apache/commons/math3/linear/BlockRealMatrix.java @@ -266,11 +266,13 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable } /** {@inheritDoc} */ + @Override public BlockRealMatrix createMatrix(final int rowDimension, final int columnDimension) { return new BlockRealMatrix(rowDimension, columnDimension); } /** {@inheritDoc} */ + @Override public BlockRealMatrix copy() { // create an empty matrix BlockRealMatrix copied = new BlockRealMatrix(rows, columns); @@ -1126,6 +1128,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable } /** {@inheritDoc} */ + @Override public double getEntry(final int row, final int column) { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; @@ -1136,6 +1139,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable } /** {@inheritDoc} */ + @Override public void setEntry(final int row, final int column, final double value) { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; diff --git a/src/main/java/org/apache/commons/math3/linear/OpenMapRealMatrix.java b/src/main/java/org/apache/commons/math3/linear/OpenMapRealMatrix.java index 4177dca51..6c7bf51a4 100644 --- a/src/main/java/org/apache/commons/math3/linear/OpenMapRealMatrix.java +++ b/src/main/java/org/apache/commons/math3/linear/OpenMapRealMatrix.java @@ -69,11 +69,13 @@ public class OpenMapRealMatrix extends AbstractRealMatrix } /** {@inheritDoc} */ + @Override public OpenMapRealMatrix copy() { return new OpenMapRealMatrix(this); } /** {@inheritDoc} */ + @Override public OpenMapRealMatrix createMatrix(int rowDimension, int columnDimension) { return new OpenMapRealMatrix(rowDimension, columnDimension); } @@ -209,6 +211,7 @@ public class OpenMapRealMatrix extends AbstractRealMatrix } /** {@inheritDoc} */ + @Override public double getEntry(int row, int column) { MatrixUtils.checkRowIndex(this, row); MatrixUtils.checkColumnIndex(this, column); @@ -222,6 +225,7 @@ public class OpenMapRealMatrix extends AbstractRealMatrix } /** {@inheritDoc} */ + @Override public void setEntry(int row, int column, double value) { MatrixUtils.checkRowIndex(this, row); MatrixUtils.checkColumnIndex(this, column);