chiark / gitweb /
make sure minf is initialized to HUGE_VAL before calling any optimization routine
authorstevenj <stevenj@alum.mit.edu>
Wed, 18 Nov 2009 05:57:31 +0000 (00:57 -0500)
committerstevenj <stevenj@alum.mit.edu>
Wed, 18 Nov 2009 05:57:31 +0000 (00:57 -0500)
darcs-hash:20091118055731-c8de0-e3ad0a0f08aa9c4eadca0572f9b43dae7131ce85.gz

api/nlopt.c

index 72554556bab6227ce8b7b567daa206e478bfd47a..46170f6116511fa37c00e099d3106299c980f45d 100644 (file)
@@ -304,6 +304,8 @@ static nlopt_result nlopt_minimize_(
      if (p != 0 && !AUGLAG_ALG(algorithm) && algorithm != NLOPT_GN_ISRES)
          return NLOPT_INVALID_ARGS;
 
+     *minf = HUGE_VAL;
+
      d.f = f;
      d.f_data = f_data;
      d.lb = lb;