psteitz 2004/10/24 20:12:28
Modified: math/src/java/org/apache/commons/math/linear BigMatrix.java
BigMatrixImpl.java
Log:
Removed entry mutators, making BigMatrix instances immutable (like RealMatrix).
Revision Changes Path
1.9 +1 -95
jakarta-commons/math/src/java/org/apache/commons/math/linear/BigMatrix.java
Index: BigMatrix.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/linear/BigMatrix.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BigMatrix.java 25 Oct 2004 02:21:20 -0000 1.8
+++ BigMatrix.java 25 Oct 2004 03:12:28 -0000 1.9
@@ -103,40 +103,6 @@
*/
double [][] getDataAsDoubleArray();
- /**
- * Overwrites the underlying data for the matrix with
- * a fresh copy of <code>data</code>.
- *
- * @param data 2-dimensional array of entries
- */
- void setData(BigDecimal[][] data);
-
- /**
- * Overwrites the underlying data for the matrix with
- * a fresh copy of <code>data</code>.
- *
- * @param data 2-dimensional array of entries
- */
- void setData(double[][] data);
-
- /**
- * Overwrites the underlying data for the matrix with
- * <code>BigDecimal</code> entries with values represented by the strings
- * in <code>data</code>.
- *
- * @param data 2-dimensional array of entries
- * @throws NumberFormatException if any of the entries in <code>data</code>
- * are not valid representations of <code>BigDecimal</code> values
- */
- void setData(String[][] data);
-
- /***
- * Sets the rounding mode to use when dividing values
- * @see java.math.BigDecimal
- * @param roundingMode
- */
- void setRoundingMode(int roundingMode);
-
/***
* Gets the rounding mode
* @return the rounding mode
@@ -282,66 +248,6 @@
* @throws MatrixIndexException if the row or column index is not valid
*/
double getEntryAsDouble(int row, int column) throws MatrixIndexException;
-
- /**
- * Sets the entry in the specified row and column to the specified value.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws org.apache.commons.math.linear.MatrixIndexException if the row
- * or column index is not valid
- */
- void setEntry(int row, int column, BigDecimal value)
- throws MatrixIndexException;
-
- /**
- * Sets the entry in the specified row and column to the specified value.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws org.apache.commons.math.linear.MatrixIndexException if the row
- * or column index is not valid
- */
- void setEntry(int row, int column, double value)
- throws MatrixIndexException;
-
- /**
- * Sets the entry in the specified row and column to the
- * <code>BigDecimal</code> value represented by the input string.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws org.apache.commons.math.linear.MatrixIndexException if the
- * row or column index is not valid
- * @throws NumberFormatException if <code>value</code> is not a valid
- * representation of a <code>BigDecimal</code> value
- */
- void setEntry(int row, int column, String value)
- throws MatrixIndexException;
/**
* Returns the transpose of this matrix.
1.8 +1 -115
jakarta-commons/math/src/java/org/apache/commons/math/linear/BigMatrixImpl.java
Index: BigMatrixImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/linear/BigMatrixImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BigMatrixImpl.java 25 Oct 2004 02:21:20 -0000 1.7
+++ BigMatrixImpl.java 25 Oct 2004 03:12:28 -0000 1.8
@@ -314,42 +314,6 @@
}
/**
- * Overwrites the underlying data for the matrix
- * with a fresh copy of <code>inData</code>.
- *
- * @param inData 2-dimensional array of entries
- */
- public void setData(BigDecimal[][] inData) {
- copyIn(inData);
- lu = null;
- }
-
- /**
- * Overwrites the underlying data for the matrix
- * with a fresh copy of <code>inData</code>.
- *
- * @param inData 2-dimensional array of entries
- */
- public void setData(double[][] inData) {
- copyIn(inData);
- lu = null;
- }
-
- /**
- * Overwrites the underlying data for the matrix with
- * <code>BigDecimal</code> entries with values represented by the strings
- * in <code>data</code>.
- *
- * @param data 2-dimensional array of entries
- * @throws NumberFormatException if any of the entries in <code>data</code>
- * are not valid representations of <code>BigDecimal</code> values
- */
- public void setData(String[][] data) {
- copyIn(data);
- lu = null;
- }
-
- /**
* Returns a reference to the underlying data array.
* <p>
* Does not make a fresh copy of the underlying data.
@@ -360,19 +324,6 @@
return data;
}
- /**
- * Overwrites the underlying data for the matrix
- * with a reference to <code>inData</code>.
- * <p>
- * Does not make a fresh copy of <code>data</code>.
- *
- * @param inData 2-dimensional array of entries
- */
- public void setDataRef(BigDecimal[][] inData) {
- this.data = inData;
- lu = null;
- }
-
/***
* Gets the rounding mode for division operations
* The default is [EMAIL PROTECTED] java.math.BigDecimal#ROUND_HALF_UP}
@@ -660,71 +611,6 @@
*/
public double getEntryAsDouble(int row, int column) throws MatrixIndexException
{
return getEntry(row,column).doubleValue();
- }
-
- /**
- * Sets the entry in the specified row and column to the specified value.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws MatrixIndexException if the row or column index is not valid
- */
- public void setEntry(int row, int column, BigDecimal value)
- throws MatrixIndexException {
- if (!isValidCoordinate(row,column)) {
- throw new MatrixIndexException("matrix entry does not exist");
- }
- data[row][column] = value;
- lu = null;
- }
-
- /**
- * Sets the entry in the specified row and column to the specified value.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws MatrixIndexException if the row or column index is not valid
- */
- public void setEntry(int row, int column, double value) throws
MatrixIndexException {
- setEntry(row, column, new BigDecimal(value));
- }
-
- /**
- * Sets the entry in the specified row and column to the
- * <code>BigDecimal</code> value represented by the input string.
- * <p>
- * Row and column indices start at 0 and must satisfy
- * <ul>
- * <li><code>0 <= row < rowDimension</code></li>
- * <li><code> 0 <= column < columnDimension</code></li>
- * </ul>
- * otherwise a <code>MatrixIndexException</code> is thrown.
- *
- * @param row row location of entry to be set
- * @param column column location of entry to be set
- * @param value value to set
- * @throws MatrixIndexException if the row or column index is not valid
- * @throws NumberFormatException if <code>value</code> is not a valid
- * representation of a <code>BigDecimal</code> value
- */
- public void setEntry(int row, int column, String value) throws
MatrixIndexException {
- setEntry(row, column, new BigDecimal(value));
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]