commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1369591 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java
Date Sun, 05 Aug 2012 14:00:33 GMT
Author: tn
Date: Sun Aug  5 14:00:33 2012
New Revision: 1369591

URL: http://svn.apache.org/viewvc?rev=1369591&view=rev
Log:
Fixed warnings spotted by checkgilles.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java?rev=1369591&r1=1369590&r2=1369591&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/linear/SimplexSolver.java
Sun Aug  5 14:00:33 2012
@@ -140,10 +140,11 @@ public class SimplexSolver extends Abstr
             if (getIterations() < getMaxIterations() / 2) {
                 Integer minRow = null;
                 int minIndex = tableau.getWidth();
+                final int varStart = tableau.getNumObjectiveFunctions();
+                final int varEnd = tableau.getWidth() - 1;
                 for (Integer row : minRatioPositions) {
-                    int i = tableau.getNumObjectiveFunctions();
-                    for (; i < tableau.getWidth() - 1 && !row.equals(minRow);
i++) {
-                        Integer basicRow = tableau.getBasicRow(i);
+                    for (int i = varStart; i < varEnd && !row.equals(minRow);
i++) {
+                        final Integer basicRow = tableau.getBasicRow(i);
                         if (basicRow != null && basicRow.equals(row)) {
                             if (i < minIndex) {
                                 minIndex = i;



Mime
View raw message