提交 0d770f22 编写于 作者: S stevenj

only check ftol on iterations where fmin decreased; seems to make this...

only check ftol on iterations where fmin decreased; seems to make this stopping condition much more useful

darcs-hash:20070829045201-c8de0-241983936b8a9a08b449d4018baa6d6a9d226c22.gz
上级 a4c19a8b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册