From c59c6152fe45b03a290f82dc3960318185ae4387 Mon Sep 17 00:00:00 2001 From: Jianbo He Date: Wed, 1 Jan 2020 16:42:11 +0800 Subject: [PATCH] Fixed convergence check for equal likelihood values https://github.com/StoreyLab/terastructure/issues/10 --- src/snpsamplinge.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snpsamplinge.cc b/src/snpsamplinge.cc index e973b49..9f62498 100644 --- a/src/snpsamplinge.cc +++ b/src/snpsamplinge.cc @@ -510,7 +510,7 @@ SNPSamplingE::compute_likelihood(bool first, bool validation) bool stop = false; int why = -1; if (_iter > 2000) { - if (a > _prev_h && + if (a >= _prev_h && _prev_h != 0 && fabs((a - _prev_h) / _prev_h) < _env.stop_threshold) { stop = true; why = 0;