From a063207a50eaea9654a1cdbbbcfcc3949ef2afa3 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sun, 12 Apr 2020 17:33:46 +0200 Subject: [PATCH] Allow force_stop with dimension elimination Closes #317 --- src/api/optimize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/optimize.c b/src/api/optimize.c index 43cb66ac..a9d1837f 100644 --- a/src/api/optimize.c +++ b/src/api/optimize.c @@ -851,6 +851,7 @@ nlopt_result NLOPT_STDCALL nlopt_optimize(nlopt_opt opt, double *x, double *opt_ goto done; } elimdim_shrink(opt->n, x, opt->lb, opt->ub); + opt->force_stop_child = elim_opt; } ret = nlopt_optimize_(elim_opt, x, opt_f); @@ -858,6 +859,7 @@ nlopt_result NLOPT_STDCALL nlopt_optimize(nlopt_opt opt, double *x, double *opt_ if (elim_opt != opt) { elimdim_destroy(elim_opt); elimdim_expand(opt->n, x, opt->lb, opt->ub); + opt->force_stop_child = NULL; } }