Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C6F09920 for ; Sun, 5 Aug 2012 14:01:19 +0000 (UTC) Received: (qmail 58309 invoked by uid 500); 5 Aug 2012 14:01:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 58231 invoked by uid 500); 5 Aug 2012 14:01:18 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 58218 invoked by uid 99); 5 Aug 2012 14:01:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Aug 2012 14:01:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Aug 2012 14:01:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 039DD2388A6E for ; Sun, 5 Aug 2012 14:00:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: tn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120805140034.039DD2388A6E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;