chiark / gitweb /
Use trusty
[nlopt.git] / praxis / praxis.c
index f68e28bc425f8f13e306c5233216bec91d4cc083..a032904847c185062db1fdf18f4021ab88e6107a 100644 (file)
@@ -622,7 +622,7 @@ static void minfit_(int m, int n, double machep,
 
     /* Local variables */
     double *e; /* size n */
-    double c__, f, g, h__;
+    double c__, f = 0.0, g, h__;
     int i__, j, k, l;
     double s, x, y, z__;
     int l2, ii, kk, kt, ll2, lp1;
@@ -1241,7 +1241,8 @@ L4:
         q_1->fbest = ret_val;
         memcpy(q_1->xbest, t, n * sizeof(double));
     }
-    if (nlopt_stop_evals(stop)) *ret = NLOPT_MAXEVAL_REACHED;
+    if (nlopt_stop_forced(stop)) *ret = NLOPT_FORCED_STOP;
+    else if (nlopt_stop_evals(stop)) *ret = NLOPT_MAXEVAL_REACHED;
     else if (nlopt_stop_time(stop)) *ret = NLOPT_MAXTIME_REACHED;
     else if (ret_val <= stop->minf_max) *ret = NLOPT_MINF_MAX_REACHED;
     return ret_val;