commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r701857 - /commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java
Date Sun, 05 Oct 2008 19:16:18 GMT
Author: luc
Date: Sun Oct  5 12:16:18 2008
New Revision: 701857

URL: http://svn.apache.org/viewvc?rev=701857&view=rev
Log:
removed unneeded multiplications by zero by separating
the first iteration from the following ones in a loop
(once again ...)

Modified:
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java?rev=701857&r1=701856&r2=701857&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/linear/TriDiagonalTransformer.java
Sun Oct  5 12:16:18 2008
@@ -123,12 +123,12 @@
                     for (int j = k + 1; j < m; ++j) {
                         final double[] qtJ = qtData[j];
                         beta = 0;
-                        for (int i = k; i < m; ++i) {
+                        for (int i = k + 1; i < m; ++i) {
                             beta += qtJ[i] * hK[i];
                         }
                         beta *= inv;
-
-                        for (int i = k; i < m; ++i) {
+                        qtJ[k] = beta * hK[k];
+                        for (int i = k + 1; i < m; ++i) {
                             qtJ[i] += beta * hK[i];
                         }
                     }



Mime
View raw message