From: stevenj Date: Tue, 11 Nov 2008 05:20:39 +0000 (-0500) Subject: work around NaN in cobyla that occurs if we run it for too many iterations past the... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8bb3a41cc208eb10ee374c7c9eb88267586fc5fb;p=nlopt.git work around NaN in cobyla that occurs if we run it for too many iterations past the point where it has converged to machine precision darcs-hash:20081111052039-c8de0-6c6f2e7b8ec8e368aa1d96eed86b33b11bf257f7.gz --- diff --git a/cobyla/cobyla.c b/cobyla/cobyla.c index d3d1db1..9a669bd 100644 --- a/cobyla/cobyla.c +++ b/cobyla/cobyla.c @@ -533,7 +533,7 @@ L140: temp += -1.; } i__3 = *n; - for (k = 1; k <= i__3; ++k) { + for (k = 1; k <= i__3; ++k) if (sim[k + j * sim_dim1] != 0) { temp += simi[i__ + k * simi_dim1] * sim[k + j * sim_dim1]; } d__1 = error, d__2 = abs(temp);