removed evenPermutation and isSingular for consistency with other decomposition solvers

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@728917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2008-12-23 10:17:11 +00:00
parent 2cb4fc8a84
commit 6c48638cc5
3 changed files with 14 additions and 30 deletions

View File

@ -29,8 +29,14 @@ import java.io.Serializable;
* <p>This interface is based on the class with similar name from the now defunct * <p>This interface is based on the class with similar name from the now defunct
* <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library.</p> * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library.</p>
* <ul> * <ul>
* <li>a {@link #getSolver() getSolver} method has been added.</li> * <li>a {@link #getP() getP} method has been added,</li>
* <li>the <code>det</code> method has been renamed as {@link #getDeterminant() getDeterminant}.</li> * <li>the <code>det</code> method has been renamed as {@link #getDeterminant()
* getDeterminant},</li>
* <li>the <code>getDoublePivot</code> method has been removed (but the int based
* {@link #getPivot() getPivot} method has been kept),</li>
* <li>the <code>solve</code> and <code>isNonSingular</code> methods have been replaced
* by a {@link #getSolver() getSolver} method and the equivalent methods provided by
* the returned {@link DecompositionSolver}.</li>
* </ul> * </ul>
* *
* @see <a href="http://mathworld.wolfram.com/LUDecomposition.html">MathWorld</a> * @see <a href="http://mathworld.wolfram.com/LUDecomposition.html">MathWorld</a>
@ -72,18 +78,6 @@ public interface LUDecomposition extends Serializable {
*/ */
int[] getPivot(); int[] getPivot();
/**
* Get permutation parity.
* @return true if there was an even number of permutations
*/
boolean evenPermutation();
/**
* Get the singularity indicator.
* @return singularity indicator
*/
boolean isSingular();
/** /**
* Return the determinant of the matrix * Return the determinant of the matrix
* @return determinant of the matrix * @return determinant of the matrix
@ -91,7 +85,7 @@ public interface LUDecomposition extends Serializable {
double getDeterminant(); double getDeterminant();
/** /**
* Get a solver for A &times; X = B. * Get a solver for finding the A &times; X = B solution in exact linear sense.
* @return a solver * @return a solver
*/ */
DecompositionSolver getSolver(); DecompositionSolver getSolver();

View File

@ -224,16 +224,6 @@ public class LUDecompositionImpl implements LUDecomposition {
} }
} }
/** {@inheritDoc} */
public boolean isSingular() {
return singular;
}
/** {@inheritDoc} */
public boolean evenPermutation() {
return even;
}
/** {@inheritDoc} */ /** {@inheritDoc} */
public DecompositionSolver getSolver() { public DecompositionSolver getSolver() {
return new Solver(lu, pivot, singular); return new Solver(lu, pivot, singular);

View File

@ -116,14 +116,14 @@ public class LUDecompositionImplTest extends TestCase {
matrix = MatrixUtils.createRealMatrix(singular); matrix = MatrixUtils.createRealMatrix(singular);
lu = new LUDecompositionImpl(matrix); lu = new LUDecompositionImpl(matrix);
assertTrue(lu.isSingular()); assertFalse(lu.getSolver().isNonSingular());
assertNull(lu.getL()); assertNull(lu.getL());
assertNull(lu.getU()); assertNull(lu.getU());
assertNull(lu.getP()); assertNull(lu.getP());
matrix = MatrixUtils.createRealMatrix(bigSingular); matrix = MatrixUtils.createRealMatrix(bigSingular);
lu = new LUDecompositionImpl(matrix); lu = new LUDecompositionImpl(matrix);
assertTrue(lu.isSingular()); assertFalse(lu.getSolver().isNonSingular());
assertNull(lu.getL()); assertNull(lu.getL());
assertNull(lu.getU()); assertNull(lu.getU());
assertNull(lu.getP()); assertNull(lu.getP());
@ -207,11 +207,11 @@ public class LUDecompositionImplTest extends TestCase {
public void testSingular() { public void testSingular() {
LUDecomposition lu = LUDecomposition lu =
new LUDecompositionImpl(MatrixUtils.createRealMatrix(testData)); new LUDecompositionImpl(MatrixUtils.createRealMatrix(testData));
assertFalse(lu.isSingular()); assertTrue(lu.getSolver().isNonSingular());
lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(singular)); lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(singular));
assertTrue(lu.isSingular()); assertFalse(lu.getSolver().isNonSingular());
lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(bigSingular)); lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(bigSingular));
assertTrue(lu.isSingular()); assertFalse(lu.getSolver().isNonSingular());
} }
/** test matrices values */ /** test matrices values */