You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2011/10/19 01:12:14 UTC

svn commit: r1185917 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java

Author: erans
Date: Tue Oct 18 23:12:14 2011
New Revision: 1185917

URL: http://svn.apache.org/viewvc?rev=1185917&view=rev
Log:
MATH-621
Reordering of operations leads to unit tests failures.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java?rev=1185917&r1=1185916&r2=1185917&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java Tue Oct 18 23:12:14 2011
@@ -723,7 +723,11 @@ public class BOBYQAOptimizer
                 bsum += sum * d__.getEntry(j);
                 dx += d__.getEntry(j) * xopt.getEntry(j);
             }
-            beta = dx * dx + dsq * (xoptsq + dx + dx + HALF * dsq) + beta - bsum;
+
+            beta = dx * dx + dsq * (xoptsq + dx + dx + HALF * dsq) + beta - bsum; // Original
+            // beta += dx * dx + dsq * (xoptsq + dx + dx + HALF * dsq) - bsum; // XXX "testAckley" and "testDiffPow" fail.
+            // beta = dx * dx + dsq * (xoptsq + 2 * dx + HALF * dsq) + beta - bsum; // XXX "testDiffPow" fails.
+
             vlag.setEntry(trustRegionCenterInterpolationPointIndex,
                           vlag.getEntry(trustRegionCenterInterpolationPointIndex) + ONE);