You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2010/11/11 23:52:40 UTC
svn commit: r1034190 - in
/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear:
AbstractRealMatrix.java RealMatrix.java
Author: erans
Date: Thu Nov 11 22:52:39 2010
New Revision: 1034190
URL: http://svn.apache.org/viewvc?rev=1034190&view=rev
Log:
MATH-438
Removed deprecated methods.
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java?rev=1034190&r1=1034189&r2=1034190&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java Thu Nov 11 22:52:39 2010
@@ -35,20 +35,10 @@ import org.apache.commons.math.util.Fast
* @since 2.0
*/
public abstract class AbstractRealMatrix implements RealMatrix {
-
-
- /** Cached LU solver.
- * @deprecated as of release 2.0, since all methods using this are deprecated
- */
- @Deprecated
- private DecompositionSolver lu;
-
/**
* Creates a matrix with no data
*/
- protected AbstractRealMatrix() {
- lu = null;
- }
+ protected AbstractRealMatrix() {}
/**
* Create a new RealMatrix with the supplied row and column dimensions.
@@ -64,7 +54,6 @@ public abstract class AbstractRealMatrix
if (columnDimension < 1) {
throw new NotStrictlyPositiveException(columnDimension);
}
- lu = null;
}
/** {@inheritDoc} */
@@ -367,8 +356,6 @@ public abstract class AbstractRealMatrix
setEntry(row + i, column + j, subMatrix[i][j]);
}
}
-
- lu = null;
}
/** {@inheritDoc} */
@@ -540,37 +527,11 @@ public abstract class AbstractRealMatrix
}
/** {@inheritDoc} */
- @Deprecated
- public RealMatrix inverse()
- throws InvalidMatrixException {
- if (lu == null) {
- lu = new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getSolver();
- }
- return lu.getInverse();
- }
-
- /** {@inheritDoc} */
- @Deprecated
- public double getDeterminant()
- throws InvalidMatrixException {
- return new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getDeterminant();
- }
-
- /** {@inheritDoc} */
public boolean isSquare() {
return getColumnDimension() == getRowDimension();
}
/** {@inheritDoc} */
- @Deprecated
- public boolean isSingular() {
- if (lu == null) {
- lu = new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getSolver();
- }
- return !lu.isNonSingular();
- }
-
- /** {@inheritDoc} */
public abstract int getRowDimension();
/** {@inheritDoc} */
@@ -698,7 +659,6 @@ public abstract class AbstractRealMatrix
setEntry(row, column, newValue);
}
}
- lu = null;
return visitor.end();
}
@@ -731,7 +691,6 @@ public abstract class AbstractRealMatrix
setEntry(row, column, newValue);
}
}
- lu = null;
return visitor.end();
}
@@ -764,7 +723,6 @@ public abstract class AbstractRealMatrix
setEntry(row, column, newValue);
}
}
- lu = null;
return visitor.end();
}
@@ -797,7 +755,6 @@ public abstract class AbstractRealMatrix
setEntry(row, column, newValue);
}
}
- lu = null;
return visitor.end();
}
@@ -845,53 +802,6 @@ public abstract class AbstractRealMatrix
return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn);
}
- /** {@inheritDoc} */
- @Deprecated
- public double[] solve(final double[] b)
- throws IllegalArgumentException, InvalidMatrixException {
- if (lu == null) {
- lu = new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getSolver();
- }
- return lu.solve(b);
- }
-
- /** {@inheritDoc} */
- @Deprecated
- public RealMatrix solve(final RealMatrix b)
- throws IllegalArgumentException, InvalidMatrixException {
- if (lu == null) {
- lu = new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getSolver();
- }
- return lu.solve(b);
- }
-
- /**
- * Computes a new
- * <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf">
- * LU decomposition</a> for this matrix, storing the result for use by other methods.
- * <p>
- * <strong>Implementation Note</strong>:<br>
- * Uses <a href="http://www.damtp.cam.ac.uk/user/fdl/people/sd/lectures/nummeth98/linear.htm">
- * Crout's algorithm</a>, with partial pivoting.</p>
- * <p>
- * <strong>Usage Note</strong>:<br>
- * This method should rarely be invoked directly. Its only use is
- * to force recomputation of the LU decomposition when changes have been
- * made to the underlying data using direct array references. Changes
- * made using setXxx methods will trigger recomputation when needed
- * automatically.</p>
- *
- * @throws InvalidMatrixException if the matrix is non-square or singular.
- * @deprecated as of release 2.0, replaced by {@link LUDecomposition}
- */
- @Deprecated
- public void luDecompose()
- throws InvalidMatrixException {
- if (lu == null) {
- lu = new LUDecompositionImpl(this, MathUtils.SAFE_MIN).getSolver();
- }
- }
-
/**
* Get a string representation for this matrix.
* @return a string representation for this matrix
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java?rev=1034190&r1=1034189&r2=1034190&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java Thu Nov 11 22:52:39 2010
@@ -425,44 +425,6 @@ public interface RealMatrix extends AnyM
RealMatrix transpose();
/**
- * Returns the inverse of this matrix.
- *
- * @return inverse matrix
- * @throws InvalidMatrixException if this is not invertible
- * @deprecated as of release 2.0, replaced by <code>
- * {@link LUDecompositionImpl#LUDecompositionImpl(RealMatrix)
- * new LUDecompositionImpl(m)}.{@link LUDecomposition#getSolver()
- * getSolver()}.{@link DecompositionSolver#getInverse()
- * getInverse()}</code>
- */
- @Deprecated
- RealMatrix inverse();
-
- /**
- * Returns the determinant of this matrix.
- *
- * @return determinant
- * @deprecated as of release 2.0, replaced by <code>
- * {@link LUDecompositionImpl#LUDecompositionImpl(RealMatrix)
- * new LUDecompositionImpl(m)}.{@link LUDecomposition#getDeterminant()
- * getDeterminant()}</code>
- */
- @Deprecated
- double getDeterminant();
-
- /**
- * Is this a singular matrix?
- * @return true if the matrix is singular
- * @deprecated as of release 2.0, replaced by the boolean negation of
- * <code>{@link LUDecompositionImpl#LUDecompositionImpl(RealMatrix)
- * new LUDecompositionImpl(m)}.{@link LUDecomposition#getSolver()
- * getSolver()}.{@link DecompositionSolver#isNonSingular()
- * isNonSingular()}</code>
- */
- @Deprecated
- boolean isSingular();
-
- /**
* Returns the <a href="http://mathworld.wolfram.com/MatrixTrace.html">
* trace</a> of the matrix (the sum of the elements on the main diagonal).
*
@@ -821,32 +783,4 @@ public interface RealMatrix extends AnyM
*/
double walkInOptimizedOrder(RealMatrixPreservingVisitor visitor,
int startRow, int endRow, int startColumn, int endColumn);
-
- /**
- * Returns the solution vector for a linear system with coefficient
- * matrix = this and constant vector = <code>b</code>.
- *
- * @param b constant vector
- * @return vector of solution values to AX = b, where A is *this
- * @throws IllegalArgumentException if this.rowDimension != b.length
- * @throws InvalidMatrixException if this matrix is not square or is singular
- * @deprecated as of release 2.0, replaced by {@link DecompositionSolver#solve(double[])}
- */
- @Deprecated
- double[] solve(double[] b);
-
- /**
- * Returns a matrix of (column) solution vectors for linear systems with
- * coefficient matrix = this and constant vectors = columns of
- * <code>b</code>.
- *
- * @param b matrix of constant vectors forming RHS of linear systems to
- * to solve
- * @return matrix of solution vectors
- * @throws IllegalArgumentException if this.rowDimension != row dimension
- * @throws InvalidMatrixException if this matrix is not square or is singular
- * @deprecated as of release 2.0, replaced by {@link DecompositionSolver#solve(RealMatrix)}
- */
- @Deprecated
- RealMatrix solve(RealMatrix b);
}