From: stevenj Date: Sat, 20 Nov 2010 18:44:03 +0000 (-0500) Subject: default to mf=10 in luksan codes, like in Fortran, not mf=4, and remove pointless... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fa7ec60eff0d69019a8c53688dda10090624a6fb;p=nlopt.git default to mf=10 in luksan codes, like in Fortran, not mf=4, and remove pointless -5 from maxeval upper bound, and remove FIXME since this is now user-settable darcs-hash:20101120184403-c8de0-4748332bf66ad0aafc31126b97ffc5a3f105543c.gz --- diff --git a/luksan/plip.c b/luksan/plip.c index 2527dde..8f42b3a 100644 --- a/luksan/plip.c +++ b/luksan/plip.c @@ -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: diff --git a/luksan/plis.c b/luksan/plis.c index e3bcde3..84d4c0a 100644 --- a/luksan/plis.c +++ b/luksan/plis.c @@ -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: diff --git a/luksan/pnet.c b/luksan/pnet.c index d8d7ac8..bf6192e 100644 --- a/luksan/pnet.c +++ b/luksan/pnet.c @@ -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: