From: Steven G. Johnson Date: Tue, 26 May 2015 15:00:46 +0000 (-0400) Subject: bug fix in nlopt_set_lower_bounds1, thanks to @wojdyr X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=01f1d9d75a22e40ef1fe9813f5df82e08b84c06a;p=nlopt.git bug fix in nlopt_set_lower_bounds1, thanks to @wojdyr --- diff --git a/api/options.c b/api/options.c index b2ce5fe..626a38b 100644 --- a/api/options.c +++ b/api/options.c @@ -287,8 +287,8 @@ NLOPT_STDCALL nlopt_set_lower_bounds1(nlopt_opt opt, double lb) nlopt_unset_errmsg(opt); if (opt) { unsigned i; - for (i = 0; i < opt->n; ++i) - opt->lb[i] = lb; { + for (i = 0; i < opt->n; ++i) { + opt->lb[i] = lb; if (opt->lb[i] < opt->ub[i] && nlopt_istiny(opt->ub[i] - opt->lb[i])) opt->lb[i] = opt->ub[i]; }