From 707f1a61ffa0900a0bdc7304196253827eb62012 Mon Sep 17 00:00:00 2001 From: stevenj Date: Tue, 29 Jul 2008 02:34:28 -0400 Subject: [PATCH] fixed incorrect termination code darcs-hash:20080729063428-c8de0-4efc46b60530d4d75e3a05255f60ea65c635f402.gz --- mlsl/mlsl.c | 4 ++-- mma/mma.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mlsl/mlsl.c b/mlsl/mlsl.c index 2a545a7..39f81d0 100644 --- a/mlsl/mlsl.c +++ b/mlsl/mlsl.c @@ -306,7 +306,7 @@ nlopt_result mlsl_minimize(int n, nlopt_func f, void *f_data, free(p); ret = NLOPT_OUT_OF_MEMORY; } if (nlopt_stop_evals(stop)) ret = NLOPT_MAXEVAL_REACHED; - else if (nlopt_stop_time(stop)) ret = NLOPT_MAXEVAL_REACHED; + else if (nlopt_stop_time(stop)) ret = NLOPT_MAXTIME_REACHED; else if (p->f < stop->minf_max) ret = NLOPT_MINF_MAX_REACHED; while (ret == NLOPT_SUCCESS) { @@ -330,7 +330,7 @@ nlopt_result mlsl_minimize(int n, nlopt_func f, void *f_data, free(p); ret = NLOPT_OUT_OF_MEMORY; } if (nlopt_stop_evals(stop)) ret = NLOPT_MAXEVAL_REACHED; - else if (nlopt_stop_time(stop)) ret = NLOPT_MAXEVAL_REACHED; + else if (nlopt_stop_time(stop)) ret = NLOPT_MAXTIME_REACHED; else if (p->f < stop->minf_max) ret = NLOPT_MINF_MAX_REACHED; else { find_closest_pt(n, &d.pts, p); diff --git a/mma/mma.c b/mma/mma.c index 23f9ee4..fa2ae42 100644 --- a/mma/mma.c +++ b/mma/mma.c @@ -40,7 +40,7 @@ nlopt_result mma_minimize(int n, nlopt_func f, void *f_data, while (1) { /* outer iterations */ double fprev = fcur; if (nlopt_stop_evals(stop)) ret = NLOPT_MAXEVAL_REACHED; - else if (nlopt_stop_time(stop)) ret = NLOPT_MAXEVAL_REACHED; + else if (nlopt_stop_time(stop)) ret = NLOPT_MAXTIME_REACHED; else if (*minf < stop->minf_max) ret = NLOPT_MINF_MAX_REACHED; if (ret != NLOPT_SUCCESS) goto done; if (++k > 1) memcpy(xprevprev, xprev, sizeof(double) * n); @@ -75,7 +75,7 @@ nlopt_result mma_minimize(int n, nlopt_func f, void *f_data, memcpy(dfdx, dfdx_cur, sizeof(double)*n); } if (nlopt_stop_evals(stop)) ret = NLOPT_MAXEVAL_REACHED; - else if (nlopt_stop_time(stop)) ret = NLOPT_MAXEVAL_REACHED; + else if (nlopt_stop_time(stop)) ret = NLOPT_MAXTIME_REACHED; else if (*minf < stop->minf_max) ret = NLOPT_MINF_MAX_REACHED; if (ret != NLOPT_SUCCESS) goto done; -- 2.30.2