chiark / gitweb /
default to mf=10 in luksan codes, like in Fortran, not mf=4, and remove pointless...
authorstevenj <stevenj@alum.mit.edu>
Sat, 20 Nov 2010 18:44:03 +0000 (13:44 -0500)
committerstevenj <stevenj@alum.mit.edu>
Sat, 20 Nov 2010 18:44:03 +0000 (13:44 -0500)
darcs-hash:20101120184403-c8de0-4748332bf66ad0aafc31126b97ffc5a3f105543c.gz

luksan/plip.c
luksan/plis.c
luksan/pnet.c

index 2527dde85e79d9b91c3a8139a6301c7783c78bb7..8f42b3a4e972c10edaf1fe9170fbaa9e6aa62c68 100644 (file)
@@ -444,17 +444,10 @@ nlopt_result luksan_plip(int n, nlopt_func f, void *f_data,
      ix = (int*) malloc(sizeof(int) * n);
      if (!ix) return NLOPT_OUT_OF_MEMORY;
 
-     /* FIXME: what should we set mf to?  The example program tlis.for
-        sets it to zero as far as I can tell, but it seems to greatly
-       improve convergence to make it > 0.  The computation time
-       per iteration, and of course the memory, seem to go as O(n * mf),
-       and we'll assume that the main limiting factor is the memory.
-       We'll assume that at least MEMAVAIL memory, or 4*n memory, whichever
-       is bigger, is available. */
      if (mf <= 0) {
-         mf = MAX2(MEMAVAIL/n, 4);
+         mf = MAX2(MEMAVAIL/n, 10);
          if (stop->maxeval && stop->maxeval <= mf)
-              mf = MAX2(stop->maxeval - 5, 1); /* mf > maxeval seems not good */
+              mf = MAX2(stop->maxeval, 1);
      }
 
  retry_alloc:
index e3bcde3d94431c445c0c3fb43cb93bd32e7c6361..84d4c0a06f4114cacdcaa7c0c5530c29ccf7affb 100644 (file)
@@ -439,17 +439,10 @@ nlopt_result luksan_plis(int n, nlopt_func f, void *f_data,
      ix = (int*) malloc(sizeof(int) * n);
      if (!ix) return NLOPT_OUT_OF_MEMORY;
 
-     /* FIXME: what should we set mf to?  The example program tlis.for
-        sets it to zero as far as I can tell, but it seems to greatly
-       improve convergence to make it > 0.  The computation time
-       per iteration, and of course the memory, seem to go as O(n * mf),
-       and we'll assume that the main limiting factor is the memory.
-       We'll assume that at least MEMAVAIL memory, or 4*n memory, whichever
-       is bigger, is available. */
      if (mf <= 0) {
-         mf = MAX2(MEMAVAIL/n, 4);
+         mf = MAX2(MEMAVAIL/n, 10);
          if (stop->maxeval && stop->maxeval <= mf)
-              mf = MAX2(stop->maxeval - 5, 1); /* mf > maxeval seems not good */
+              mf = MAX2(stop->maxeval, 1);
      }
 
  retry_alloc:
index d8d7ac80e11b6c7e4ceb17fc034dda4261c0fc3f..bf6192eda12aa10bbc4a83c89457f1c9c2629149 100644 (file)
@@ -587,17 +587,10 @@ nlopt_result luksan_pnet(int n, nlopt_func f, void *f_data,
      ix = (int*) malloc(sizeof(int) * n);
      if (!ix) return NLOPT_OUT_OF_MEMORY;
 
-     /* FIXME: what should we set mf to?  The example program tlis.for
-        sets it to zero as far as I can tell, but it seems to greatly
-       improve convergence to make it > 0.  The computation time
-       per iteration, and of course the memory, seem to go as O(n * mf),
-       and we'll assume that the main limiting factor is the memory.
-       We'll assume that at least MEMAVAIL memory, or 4*n memory, whichever
-       is bigger, is available. */
      if (mf <= 0) {
-         mf = MAX2(MEMAVAIL/n, 4);
+         mf = MAX2(MEMAVAIL/n, 10);
          if (stop->maxeval && stop->maxeval <= mf)
-              mf = MAX2(stop->maxeval - 5, 1); /* mf > maxeval seems not good */
+              mf = MAX2(stop->maxeval, 1);
      }
 
  retry_alloc: