chiark / gitweb /
deprecated API should support xtol_abs==NULL (for 0 tol) for backward compatibility
authorstevenj <stevenj@alum.mit.edu>
Tue, 7 Dec 2010 20:18:02 +0000 (15:18 -0500)
committerstevenj <stevenj@alum.mit.edu>
Tue, 7 Dec 2010 20:18:02 +0000 (15:18 -0500)
darcs-hash:20101207201802-c8de0-d0e23236914bbfae02d15c5f0c3ee61361a9da79.gz

api/deprecated.c

index 54da189970625c7da09f2901d5db5d239d4749da..1f7dde91bc48247b3697f3b84850a82618b96f29 100644 (file)
@@ -119,7 +119,7 @@ NLOPT_STDCALL nlopt_minimize_econstrained(
 
      ret = nlopt_set_xtol_rel(opt, xtol_rel);
      if (ret != NLOPT_SUCCESS) { nlopt_destroy(opt); return ret; }
-     ret = nlopt_set_xtol_abs(opt, xtol_abs);
+     if (xtol_abs) ret = nlopt_set_xtol_abs(opt, xtol_abs);
      if (ret != NLOPT_SUCCESS) { nlopt_destroy(opt); return ret; }
      
      ret = nlopt_set_maxeval(opt, maxeval);