From: stevenj Date: Mon, 14 Jun 2010 20:55:27 +0000 (-0400) Subject: copy initial_step (if any) from opt to local_opt X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ec8f3d96278f499bad5b8a98c1f84727402be775;p=nlopt.git copy initial_step (if any) from opt to local_opt darcs-hash:20100614205527-c8de0-045ada4f1a8285d48c3b50339928fcab59e3c2d2.gz --- diff --git a/api/optimize.c b/api/optimize.c index 3235b96..11951eb 100644 --- a/api/optimize.c +++ b/api/optimize.c @@ -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, diff --git a/api/options.c b/api/options.c index 40e4791..fffa100 100644 --- a/api/options.c +++ b/api/options.c @@ -27,7 +27,6 @@ #include #include "nlopt-internal.h" -#include "nlopt-util.h" /*************************************************************************/