chiark / gitweb /
added nlopt_force_stop termination
[nlopt.git] / cobyla / cobyla.c
index 32a6520eddef36ed0dbd49730ee3f235cb70b858..a285793bc49eb57f701d96811dda3b132dcfcf14 100644 (file)
@@ -499,7 +499,8 @@ static nlopt_result cobylb(int *n, int *m, int *mpp,
      #*&!%*@ Fortran-66 spaghetti code */
 
 L40:
-  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 L600;