chiark / gitweb /
fix #24
authorSteven G. Johnson <stevenj@mit.edu>
Thu, 18 Sep 2014 16:48:47 +0000 (12:48 -0400)
committerSteven G. Johnson <stevenj@mit.edu>
Thu, 18 Sep 2014 16:48:47 +0000 (12:48 -0400)
api/optimize.c

index 49b8d340ae0b2a983dd604fc8f77da90f4e4617a..f6f1236599486a211960f0bd0c681985345932f2 100644 (file)
@@ -641,11 +641,11 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf)
                   if (nlopt_set_default_initial_step(opt, x) != NLOPT_SUCCESS)
                        return NLOPT_OUT_OF_MEMORY;
              }
-             return cobyla_minimize(n, f, f_data, 
-                                    opt->m, opt->fc,
-                                    opt->p, opt->h,
-                                    lb, ub, x, minf, &stop,
-                                    opt->dx);
+             ret = cobyla_minimize(n, f, f_data, 
+                                    opt->m, opt->fc,
+                                    opt->p, opt->h,
+                                    lb, ub, x, minf, &stop,
+                                    opt->dx);
              if (freedx) { free(opt->dx); opt->dx = NULL; }
              return ret;
         }