commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r728917 - in /commons/proper/math/trunk/src: java/org/apache/commons/math/linear/LUDecomposition.java java/org/apache/commons/math/linear/LUDecompositionImpl.java test/org/apache/commons/math/linear/LUDecompositionImplTest.java
Date Tue, 23 Dec 2008 10:17:12 GMT
Author: luc
Date: Tue Dec 23 02:17:11 2008
New Revision: 728917

URL: http://svn.apache.org/viewvc?rev=728917&view=rev
Log:
removed evenPermutation and isSingular for consistency with other decomposition solvers

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecomposition.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecompositionImpl.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUDecompositionImplTest.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecomposition.java?rev=728917&r1=728916&r2=728917&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecomposition.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecomposition.java
Tue Dec 23 02:17:11 2008
@@ -29,8 +29,14 @@
  * <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>
  * <ul>
- *   <li>a {@link #getSolver() getSolver} method has been added.</li>
- *   <li>the <code>det</code> method has been renamed as {@link #getDeterminant()
getDeterminant}.</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>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>
  *   
  * @see <a href="http://mathworld.wolfram.com/LUDecomposition.html">MathWorld</a>
@@ -73,25 +79,13 @@
     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 determinant of the matrix
      */
     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
      */
     DecompositionSolver getSolver();

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecompositionImpl.java?rev=728917&r1=728916&r2=728917&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecompositionImpl.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/linear/LUDecompositionImpl.java
Tue Dec 23 02:17:11 2008
@@ -225,16 +225,6 @@
     }
 
     /** {@inheritDoc} */
-    public boolean isSingular() {
-        return singular;
-    }
-
-    /** {@inheritDoc} */
-    public boolean evenPermutation() {
-        return even;
-    }
-
-    /** {@inheritDoc} */
     public DecompositionSolver getSolver() {
         return new Solver(lu, pivot, singular);
     }

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUDecompositionImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUDecompositionImplTest.java?rev=728917&r1=728916&r2=728917&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUDecompositionImplTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUDecompositionImplTest.java
Tue Dec 23 02:17:11 2008
@@ -116,14 +116,14 @@
 
         matrix = MatrixUtils.createRealMatrix(singular);
         lu = new LUDecompositionImpl(matrix);
-        assertTrue(lu.isSingular());
+        assertFalse(lu.getSolver().isNonSingular());
         assertNull(lu.getL());
         assertNull(lu.getU());
         assertNull(lu.getP());
 
         matrix = MatrixUtils.createRealMatrix(bigSingular);
         lu = new LUDecompositionImpl(matrix);
-        assertTrue(lu.isSingular());
+        assertFalse(lu.getSolver().isNonSingular());
         assertNull(lu.getL());
         assertNull(lu.getU());
         assertNull(lu.getP());
@@ -207,11 +207,11 @@
     public void testSingular() {
         LUDecomposition lu =
             new LUDecompositionImpl(MatrixUtils.createRealMatrix(testData));
-        assertFalse(lu.isSingular());
+        assertTrue(lu.getSolver().isNonSingular());
         lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(singular));
-        assertTrue(lu.isSingular());
+        assertFalse(lu.getSolver().isNonSingular());
         lu = new LUDecompositionImpl(MatrixUtils.createRealMatrix(bigSingular));
-        assertTrue(lu.isSingular());
+        assertFalse(lu.getSolver().isNonSingular());
     }
 
     /** test matrices values */



Mime
View raw message