From dev-return-120892-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Wed Sep 08 14:50:16 2010 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 16568 invoked from network); 8 Sep 2010 14:50:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 14:50:15 -0000 Received: (qmail 94087 invoked by uid 500); 8 Sep 2010 14:50:15 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 93503 invoked by uid 500); 8 Sep 2010 14:50:12 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 93494 invoked by uid 99); 8 Sep 2010 14:50:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 14:50:11 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [194.206.126.239] (HELO smtp.nordnet.fr) (194.206.126.239) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 14:50:03 +0000 Received: from lehrin (62.223.20.81.dynamic.adsl.abo.nordnet.fr [81.20.223.62]) by smtp.nordnet.fr (Postfix) with ESMTP id 3EEA348081 for ; Wed, 8 Sep 2010 16:49:40 +0200 (CEST) Received: by lehrin (Postfix, from userid 5001) id 62C834175; Wed, 8 Sep 2010 16:49:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lehrin.spaceroots.local X-Spam-Level: Received: from lehrin.spaceroots.local (lehrin.spaceroots.local [127.0.0.1]) by lehrin (Postfix) with ESMTP id 7B4D04173 for ; Wed, 8 Sep 2010 16:49:33 +0200 (CEST) Message-ID: <4C87A27D.9070102@free.fr> Date: Wed, 08 Sep 2010 16:49:33 +0200 From: Luc Maisonobe User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: dev@commons.apache.org Subject: Re: svn commit: r995035 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java References: <20100908125138.E4C0A23889DA@eris.apache.org> In-Reply-To: <20100908125138.E4C0A23889DA@eris.apache.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Old-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,FREEMAIL_FROM autolearn=unavailable version=3.3.1 Le 08/09/2010 14:51, erans@apache.org a écrit : > Author: erans > Date: Wed Sep 8 12:51:38 2010 > New Revision: 995035 > > URL: http://svn.apache.org/viewvc?rev=995035&view=rev > Log: > Removed strict equality comparison. In some rare cases, strict equality comparison is desired (I don't know if it is the case here). In these cases, findbugs can be configured to ignore these cases, see the findbugs-exclude-filter.xml file for an example. Luc > > Modified: > commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java > > Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java > URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java?rev=995035&r1=995034&r2=995035&view=diff > ============================================================================== > --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java (original) > +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java Wed Sep 8 12:51:38 2010 > @@ -17,6 +17,7 @@ > package org.apache.commons.math.optimization.univariate; > > import org.apache.commons.math.FunctionEvaluationException; > +import org.apache.commons.math.util.MathUtils; > import org.apache.commons.math.util.FastMath; > import org.apache.commons.math.exception.NumberIsTooSmallException; > import org.apache.commons.math.exception.NotStrictlyPositiveException; > @@ -219,12 +220,15 @@ public class BrentOptimizer extends Abst > } else { > b = u; > } > - if (fu <= fw || w == x) { > + if (fu <= fw || > + MathUtils.equals(w, x)) { > v = w; > fv = fw; > w = u; > fw = fu; > - } else if (fu <= fv || v == x || v == w) { > + } else if (fu <= fv || > + MathUtils.equals(v, x) || > + MathUtils.equals(v, w)) { > v = u; > fv = fu; > } > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org