chiark / gitweb /
only check ftol on iterations where fmin decreased; seems to make this stopping condi...
authorstevenj <stevenj@alum.mit.edu>
Wed, 29 Aug 2007 04:52:01 +0000 (00:52 -0400)
committerstevenj <stevenj@alum.mit.edu>
Wed, 29 Aug 2007 04:52:01 +0000 (00:52 -0400)
darcs-hash:20070829045201-c8de0-241983936b8a9a08b449d4018baa6d6a9d226c22.gz

cdirect/cdirect.c

index 5b7200c545db72b76fe062fb1275dda767cf4af7..3e9a40ca2739d6510a1e242f6343d1daf1283690 100644 (file)
@@ -407,7 +407,7 @@ nlopt_result cdirect_unscaled(int n, nlopt_func f, void *f_data,
          double fmin0 = p.fmin;
          ret = divide_good_rects(&p);
          if (ret != NLOPT_SUCCESS) goto done;
-         if (nlopt_stop_f(p.stop, p.fmin, fmin0)) {
+         if (p.fmin < fmin0 && nlopt_stop_f(p.stop, p.fmin, fmin0)) {
               ret = NLOPT_FTOL_REACHED;
               goto done;
          }