chiark / gitweb /
copy initial_step (if any) from opt to local_opt
authorstevenj <stevenj@alum.mit.edu>
Mon, 14 Jun 2010 20:55:27 +0000 (16:55 -0400)
committerstevenj <stevenj@alum.mit.edu>
Mon, 14 Jun 2010 20:55:27 +0000 (16:55 -0400)
darcs-hash:20100614205527-c8de0-045ada4f1a8285d48c3b50339928fcab59e3c2d2.gz

api/optimize.c
api/options.c

index 3235b96168d232653d490445649a98288e5c4704..11951eb1764bda72286c1740ccdd15f5c37c4b5b 100644 (file)
@@ -373,8 +373,8 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf)
                   nlopt_set_xtol_rel(local_opt, opt->xtol_rel);
                   nlopt_set_xtol_abs(local_opt, opt->xtol_abs);
                   nlopt_set_maxeval(local_opt, nlopt_local_search_maxeval);
-                  nlopt_set_initial_step(local_opt, opt->dx);
              }
+             if (opt->dx) nlopt_set_initial_step(local_opt, opt->dx);
              for (i = 0; i < n && stop.xtol_abs[i] > 0; ++i) ;
              if (local_opt->ftol_rel <= 0 && local_opt->ftol_abs <= 0 &&
                  local_opt->xtol_rel <= 0 && i < n) {
@@ -486,8 +486,8 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf)
                   nlopt_set_xtol_rel(local_opt, opt->xtol_rel);
                   nlopt_set_xtol_abs(local_opt, opt->xtol_abs);
                   nlopt_set_maxeval(local_opt, nlopt_local_search_maxeval);
-                  nlopt_set_initial_step(local_opt, opt->dx);
              }
+             if (opt->dx) nlopt_set_initial_step(local_opt, opt->dx);
              opt->force_stop_child = local_opt;
              ret = auglag_minimize(ni, f, f_data, 
                                    opt->m, opt->fc, 
index 40e47917ff6dd586e043a144518622ec1ae555f4..fffa1007763103e2b144456ee8cc501806697764 100644 (file)
@@ -27,7 +27,6 @@
 #include <float.h>
 
 #include "nlopt-internal.h"
-#include "nlopt-util.h"
 
 /*************************************************************************/