From: stevenj Date: Sat, 25 Aug 2007 19:43:42 +0000 (-0400) Subject: use HUGE_VAL instead of 1e6 for "infinity" in DIRECT X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=410055057d97976dda3dc5e7c3574634aaf6dd50;p=nlopt.git use HUGE_VAL instead of 1e6 for "infinity" in DIRECT darcs-hash:20070825194342-c8de0-af10ca4f976f39dd3897e612d4554d1b1c1488f1.gz --- diff --git a/direct/DIRsubrout.c b/direct/DIRsubrout.c index cdf0870..c7743e1 100644 --- a/direct/DIRsubrout.c +++ b/direct/DIRsubrout.c @@ -577,7 +577,7 @@ L40: /* | is not close anymore (since the hyper rectangle surrounding the | */ /* | current point may have shrunk). | */ /* +-----------------------------------------------------------------------+ */ - f[(i__ << 1) + 1] = 1e6f; + f[(i__ << 1) + 1] = HUGE_VAL; f[(i__ << 1) + 2] = 2.; /* +-----------------------------------------------------------------------+ */ /* | Check if any feasible point is near this infeasible point. | */ @@ -1248,7 +1248,7 @@ L50: /* 09/25/00 Added this */ /* if (f(1,1) .ge. 1.E+6) then */ if (f[4] > 0.) { - f[3] = 1e6; + f[3] = HUGE_VAL; *fmax = f[3]; *ifeasiblef = 1; } else {