From 0d770f22869132b560b3920619ff41bc127c0491 Mon Sep 17 00:00:00 2001 From: stevenj Date: Wed, 29 Aug 2007 00:52:01 -0400 Subject: [PATCH] only check ftol on iterations where fmin decreased; seems to make this stopping condition much more useful darcs-hash:20070829045201-c8de0-241983936b8a9a08b449d4018baa6d6a9d226c22.gz --- cdirect/cdirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdirect/cdirect.c b/cdirect/cdirect.c index 5b7200c..3e9a40c 100644 --- a/cdirect/cdirect.c +++ b/cdirect/cdirect.c @@ -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; } -- 2.30.2