commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1165656 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
Date Tue, 06 Sep 2011 13:05:55 GMT
Author: erans
Date: Tue Sep  6 13:05:55 2011
New Revision: 1165656

URL: http://svn.apache.org/viewvc?rev=1165656&view=rev
Log:
MATH-621
Bug (in an unexplored code path); fixing by comparison with original code.
Added exception to track unexplored path.

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=1165656&r1=1165655&r2=1165656&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 Sep  6 13:05:55 2011
@@ -538,7 +538,7 @@ public class BOBYQAOptimizer
                         bdtest = -work1.getEntry(j);
                     }
                     if (bdtest < bdtol) {
-                        curv = hq.getEntry((j + j * j) / 2 - 1);
+                        curv = hq.getEntry((j + j * j) / 2);
                         for (int k = 0; k < npt; k++) {
                             // Computing 2nd power
                             final double d1 = xpt.getEntry(k, j);
@@ -548,6 +548,7 @@ public class BOBYQAOptimizer
                         if (bdtest < bdtol) {
                             state = 650; break;
                         }
+                        throw new PathIsExploredException(); // XXX
                     }
                 }
                 state = 680; break;



Mime
View raw message