Commit be2350c0f9c650ad6cbb494ee9119ad8dfa4e8dd
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 | 248 | // Write header into logger |
| 249 | 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 | 254 | // Optimize and save best log-likelihood |
| 252 | 255 | m_obs.optimize(m_opt); |
| 253 | 256 | m_obs.errors(m_opt); |
| ... | ... | @@ -610,6 +613,9 @@ void ctulimit::ulimit_bisection(const double& min, const double& max) |
| 610 | 613 | if (std::abs(eval_mid) < m_tol) { |
| 611 | 614 | break; |
| 612 | 615 | } |
| 616 | + if (std::abs(wrk_max-wrk_min) < m_tol) { | |
| 617 | + break; | |
| 618 | + } | |
| 613 | 619 | |
| 614 | 620 | // Change boundaries for further iteration |
| 615 | 621 | if (eval_mid > 0.0) { | ... | ... |