[Deoptim-commits] r117 - pkg/DEoptim/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 10 08:22:51 CEST 2014
Author: kmm
Date: 2014-09-10 08:22:51 +0200 (Wed, 10 Sep 2014)
New Revision: 117
Modified:
pkg/DEoptim/src/de4_0.c
Log:
fix bug with reltol
Modified: pkg/DEoptim/src/de4_0.c
===================================================================
--- pkg/DEoptim/src/de4_0.c 2014-02-14 13:36:39 UTC (rev 116)
+++ pkg/DEoptim/src/de4_0.c 2014-09-10 06:22:51 UTC (rev 117)
@@ -533,8 +533,11 @@
/*if( i_iter % 10000 == 999 ) R_CheckUserInterrupt();*/
/* check relative tolerance (as in src/main/optim.c) */
+ /* kmm: not sure where the above is, but was not working as
+ advertised in help file; changed
+ */
if( fabs(t_bestC - gd_bestvalit[i_iter-1]) <
- (d_reltol * (gd_bestvalit[i_iter-1] + d_reltol)) ) {
+ (d_reltol * (fabs(gd_bestvalit[i_iter-1]) + d_reltol))) {
i_iter_tol++;
} else {
i_iter_tol = 0;
More information about the Deoptim-commits
mailing list