chiark / gitweb /
deprecated API should support xtol_abs==NULL (for 0 tol) for backward compatibility
[nlopt.git] / 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);