commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r995035 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java
Date Wed, 08 Sep 2010 12:51:38 GMT
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.

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;
                     }



Mime
View raw message