From 8bb3a41cc208eb10ee374c7c9eb88267586fc5fb Mon Sep 17 00:00:00 2001 From: stevenj Date: Tue, 11 Nov 2008 00:20:39 -0500 Subject: [PATCH] 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 --- cobyla/cobyla.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2