commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1166099 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java
Date Wed, 07 Sep 2011 10:34:49 GMT
Author: erans
Date: Wed Sep  7 10:34:49 2011
New Revision: 1166099

URL: http://svn.apache.org/viewvc?rev=1166099&view=rev
Log:
Added "final".
Moved declaration of "sum" where it is used.

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

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java?rev=1166099&r1=1166098&r2=1166099&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java
Wed Sep  7 10:34:49 2011
@@ -36,9 +36,9 @@ public class LUDecompositionImpl impleme
     /** Default bound to determine effective singularity in LU decomposition. */
     private static final double DEFAULT_TOO_SMALL = 1e-11;
     /** Entries of LU decomposition. */
-    private double lu[][];
+    private final double lu[][];
     /** Pivot permutation associated with LU decomposition */
-    private int[] pivot;
+    private final int[] pivot;
     /** Parity of the permutation associated with the LU decomposition */
     private boolean even;
     /** Singularity indicator. */
@@ -92,12 +92,10 @@ public class LUDecompositionImpl impleme
         // Loop over columns
         for (int col = 0; col < m; col++) {
 
-            double sum = 0;
-
             // upper
             for (int row = 0; row < col; row++) {
                 final double[] luRow = lu[row];
-                sum = luRow[col];
+                double sum = luRow[col];
                 for (int i = 0; i < row; i++) {
                     sum -= luRow[i] * lu[i][col];
                 }
@@ -109,7 +107,7 @@ public class LUDecompositionImpl impleme
             double largest = Double.NEGATIVE_INFINITY;
             for (int row = col; row < m; row++) {
                 final double[] luRow = lu[row];
-                sum = luRow[col];
+                double sum = luRow[col];
                 for (int i = 0; i < col; i++) {
                     sum -= luRow[i] * lu[i][col];
                 }



Mime
View raw message