Commit be2350c0f9c650ad6cbb494ee9119ad8dfa4e8dd

Authored by Jürgen Knödlseder
1 parent a1ff2d3a

ctulimit: Make sure that requested model parameter is free and stop iterations if interval is small

Showing 1 changed file with 6 additions and 0 deletions
src/ctulimit/ctulimit.cpp
@@ -248,6 +248,9 @@ void ctulimit::run(void) @@ -248,6 +248,9 @@ void ctulimit::run(void)
248 // Write header into logger 248 // Write header into logger
249 log_header1(TERSE, "Compute best-fit likelihood"); 249 log_header1(TERSE, "Compute best-fit likelihood");
250 250
  251 + // Make sure that requested model parameters is free
  252 + m_model_par->free();
  253 +
251 // Optimize and save best log-likelihood 254 // Optimize and save best log-likelihood
252 m_obs.optimize(m_opt); 255 m_obs.optimize(m_opt);
253 m_obs.errors(m_opt); 256 m_obs.errors(m_opt);
@@ -610,6 +613,9 @@ void ctulimit::ulimit_bisection(const double& min, const double& max) @@ -610,6 +613,9 @@ void ctulimit::ulimit_bisection(const double& min, const double& max)
610 if (std::abs(eval_mid) < m_tol) { 613 if (std::abs(eval_mid) < m_tol) {
611 break; 614 break;
612 } 615 }
  616 + if (std::abs(wrk_max-wrk_min) < m_tol) {
  617 + break;
  618 + }
613 619
614 // Change boundaries for further iteration 620 // Change boundaries for further iteration
615 if (eval_mid > 0.0) { 621 if (eval_mid > 0.0) {