commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1157352 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
Date Sat, 13 Aug 2011 08:57:44 GMT
Author: erans
Date: Sat Aug 13 08:57:44 2011
New Revision: 1157352

URL: http://svn.apache.org/viewvc?rev=1157352&view=rev
Log:
Changed loop condition to avoid additional test.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java?rev=1157352&r1=1157351&r2=1157352&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
Sat Aug 13 08:57:44 2011
@@ -264,10 +264,7 @@ public class SingularValueDecompositionI
             // kase = 3     if e[k-1] is negligible, k<p, and
             //              s(k), ..., s(p) are not negligible (qr step).
             // kase = 4     if e(p-1) is negligible (convergence).
-            for (k = p - 2; k >= -1; k--) {
-                if (k == -1) {
-                    break;
-                }
+            for (k = p - 2; k >= 0; k--) {
                 final double threshold
                     = TINY + EPS * (FastMath.abs(singularValues[k]) +
                                     FastMath.abs(singularValues[k + 1]));
@@ -276,6 +273,7 @@ public class SingularValueDecompositionI
                     break;
                 }
             }
+
             if (k == p - 2) {
                 kase = 4;
             } else {



Mime
View raw message