Skip to content

Commit

Permalink
step 2: if not solution found, chose "best" one
Browse files Browse the repository at this point in the history
where "best" is defined to be the one which minimizes all tadpoles at
most.
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Oct 5, 2016
1 parent e1b82c0 commit 3432967
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions templates/mass_eigenstates.cpp.in
Expand Up @@ -305,6 +305,17 @@ int CLASSNAME::solve_ewsb_iteratively()
WARNING("\tCould not find a solution to the EWSB equations!"
" (requested precision: " << ewsb_iteration_precision << ")");
#endif

const auto best_solver =
std::min_element(std::begin(solvers), std::end(solvers),
[this](const std::unique_ptr<EWSB_solver>& a, const std::unique_ptr<EWSB_solver>& b) {
CLASSNAME ma(*this), mb(*this);
ma.set_ewsb_solution(a.get());
mb.set_ewsb_solution(b.get());
return Total(Abs(Re(ma.tadpole_equations()))) < Total(Abs(Re(mb.tadpole_equations())));
});

set_ewsb_solution(best_solver->get());
}

return status;
Expand Down

0 comments on commit 3432967

Please sign in to comment.