From be2350c0f9c650ad6cbb494ee9119ad8dfa4e8dd Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 26 Jan 2017 14:09:57 +0100 Subject: [PATCH] ctulimit: Make sure that requested model parameter is free and stop iterations if interval is small --- src/ctulimit/ctulimit.cpp | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/src/ctulimit/ctulimit.cpp b/src/ctulimit/ctulimit.cpp index 4eddd9c..7738a0f 100644 --- a/src/ctulimit/ctulimit.cpp +++ b/src/ctulimit/ctulimit.cpp @@ -248,6 +248,9 @@ void ctulimit::run(void) // Write header into logger log_header1(TERSE, "Compute best-fit likelihood"); + // Make sure that requested model parameters is free + m_model_par->free(); + // Optimize and save best log-likelihood m_obs.optimize(m_opt); m_obs.errors(m_opt); @@ -610,6 +613,9 @@ void ctulimit::ulimit_bisection(const double& min, const double& max) if (std::abs(eval_mid) < m_tol) { break; } + if (std::abs(wrk_max-wrk_min) < m_tol) { + break; + } // Change boundaries for further iteration if (eval_mid > 0.0) { -- libgit2 0.21.4