chiark / gitweb /
added nlopt_force_stop termination
[nlopt.git] / newuoa / newuoa.c
index 233b325bdcf6507a768b4e2453041701b2a73f70..d993813ad1a7eb4887ed24e5707c059f7cb07ae9 100644 (file)
@@ -2099,7 +2099,8 @@ L290:
     }
     ++nf;
 L310:
-    if (nlopt_stop_evals(stop)) rc = NLOPT_MAXEVAL_REACHED;
+    if (nlopt_stop_forced(stop)) rc = NLOPT_FORCE_STOP;
+    else if (nlopt_stop_evals(stop)) rc = NLOPT_MAXEVAL_REACHED;
     else if (nlopt_stop_time(stop)) rc = NLOPT_MAXTIME_REACHED;
     if (rc != NLOPT_SUCCESS) goto L530;