commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1382441 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java
Date Sun, 09 Sep 2012 10:40:55 GMT
Author: erans
Date: Sun Sep  9 10:40:55 2012
New Revision: 1382441

URL: http://svn.apache.org/viewvc?rev=1382441&view=rev
Log:
MATH-855
In case of tie, return the "oldest" point.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java?rev=1382441&r1=1382440&r2=1382441&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/univariate/BrentOptimizer.java
Sun Sep  9 10:40:55 2012
@@ -233,8 +233,8 @@ public class BrentOptimizer extends Base
                 previous = current;
                 current = new UnivariatePointValuePair(u, isMinim ? fu : -fu);
                 best = best(best,
-                            best(current,
-                                 previous,
+                            best(previous,
+                                 current,
                                  isMinim),
                             isMinim);
 
@@ -278,8 +278,8 @@ public class BrentOptimizer extends Base
                 }
             } else { // Default termination (Brent's criterion).
                 return best(best,
-                            best(current,
-                                 previous,
+                            best(previous,
+                                 current,
                                  isMinim),
                             isMinim);
             }



Mime
View raw message