chiark / gitweb /
bug fix - xtol is only met if true for *all* components of x, not just for one
authorstevenj <stevenj@alum.mit.edu>
Tue, 29 Jul 2008 06:13:20 +0000 (02:13 -0400)
committerstevenj <stevenj@alum.mit.edu>
Tue, 29 Jul 2008 06:13:20 +0000 (02:13 -0400)
darcs-hash:20080729061320-c8de0-77347389447843be32fb38d6050893f706c271d1.gz

util/stop.c

index 7c4732e64ae03dcf28faa9b69d2d998d9ae0e1fa..9a4e7826c44343727151245cd33adf144a465ebf 100644 (file)
@@ -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)