From 1afcb865334fcbadcc01afc57de14b6ac020a391 Mon Sep 17 00:00:00 2001 From: stevenj Date: Tue, 29 Jul 2008 02:13:20 -0400 Subject: [PATCH] bug fix - xtol is only met if true for *all* components of x, not just for one darcs-hash:20080729061320-c8de0-77347389447843be32fb38d6050893f706c271d1.gz --- util/stop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/stop.c b/util/stop.c index 7c4732e..9a4e782 100644 --- a/util/stop.c +++ b/util/stop.c @@ -23,9 +23,9 @@ int nlopt_stop_x(const nlopt_stopping *s, const double *x, const double *oldx) { int i; for (i = 0; i < s->n; ++i) - if (relstop(oldx[i], x[i], s->xtol_rel, s->xtol_abs[i])) - return 1; - return 0; + if (!relstop(oldx[i], x[i], s->xtol_rel, s->xtol_abs[i])) + return 0; + return 1; } static double sc(double x, double smin, double smax) -- GitLab