From: stevenj Date: Tue, 17 Nov 2009 21:17:11 +0000 (-0500) Subject: fixes to nlopt stop cases in BOBYQA X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7c6af0fb37b008017ffe9040435a1d2de79911cf;p=nlopt.git fixes to nlopt stop cases in BOBYQA darcs-hash:20091117211711-c8de0-f08774fcd3cfefe2d33029d6561b60d51b5cae6a.gz --- diff --git a/bobyqa/bobyqa.c b/bobyqa/bobyqa.c index 51f5ddb..0161621 100644 --- a/bobyqa/bobyqa.c +++ b/bobyqa/bobyqa.c @@ -2578,10 +2578,12 @@ L360: if (ntrits == -1) { fsave = f; rc = NLOPT_XTOL_REACHED; + if (fsave < fval[kopt]) { *minf = f; return rc; } goto L720; } if (f < stop->minf_max) { + *minf = f; return NLOPT_MINF_MAX_REACHED; } @@ -2809,6 +2811,10 @@ L360: gopt[i__] += temp * xpt[k + i__ * xpt_dim1]; } } + if (nlopt_stop_ftol(stop, f, fopt)) { + rc = NLOPT_FTOL_REACHED; + goto L720; + } } /* Calculate the parameters of the least Frobenius norm interpolant to */