From edf56632b8a5413f5e0adfe2d1b65e595b88a1d0 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Tue, 31 Dec 2013 15:40:35 +0000 Subject: [PATCH] Rename local variable to avoid masking a member variable. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1554544 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/math3/optim/linear/SimplexTableau.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/math3/optim/linear/SimplexTableau.java b/src/main/java/org/apache/commons/math3/optim/linear/SimplexTableau.java index 06ab424c9..e80c9c411 100644 --- a/src/main/java/org/apache/commons/math3/optim/linear/SimplexTableau.java +++ b/src/main/java/org/apache/commons/math3/optim/linear/SimplexTableau.java @@ -447,7 +447,7 @@ class SimplexTableau implements Serializable { Integer negativeVarBasicRow = negativeVarColumn > 0 ? getBasicRow(negativeVarColumn) : null; double mostNegative = negativeVarBasicRow == null ? 0 : getEntry(negativeVarBasicRow, getRhsOffset()); - final Set basicRows = new HashSet(); + final Set usedBasicRows = new HashSet(); final double[] coefficients = new double[getOriginalNumDecisionVariables()]; for (int i = 0; i < coefficients.length; i++) { int colIndex = columnLabels.indexOf("x" + i); @@ -461,12 +461,12 @@ class SimplexTableau implements Serializable { // set the coefficient to 0 -> this case handles unconstrained // variables that are still part of the objective function coefficients[i] = 0; - } else if (basicRows.contains(basicRow)) { + } else if (usedBasicRows.contains(basicRow)) { // if multiple variables can take a given value // then we choose the first and set the rest equal to 0 coefficients[i] = 0 - (restrictToNonNegative ? 0 : mostNegative); } else { - basicRows.add(basicRow); + usedBasicRows.add(basicRow); coefficients[i] = (basicRow == null ? 0 : getEntry(basicRow, getRhsOffset())) - (restrictToNonNegative ? 0 : mostNegative);