Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hlefebvr/idol
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Sep 30, 2024
2 parents ad1a6ac + 0a2e7c7 commit 780b27c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ bool idol::Optimizers::PADM::solve_sub_problem(unsigned int t_sub_problem_id) {
return true;
}

bool has_changed = m_inner_loop_iterations == 0 || std::abs(m_last_solutions[t_sub_problem_id].objective_value() - model.get_best_obj()) > 1e-4;
m_last_solutions[t_sub_problem_id] = save_primal(model);
auto current_solution = save_primal(model);
// bool has_changed = m_inner_loop_iterations == 0 || (m_last_solutions[t_sub_problem_id] + -1. * current_solution).norm(2) > 1e-4;
const bool has_changed = m_inner_loop_iterations == 0 || std::abs(m_last_solutions[t_sub_problem_id].objective_value() - current_solution.objective_value()) > 1e-4;
m_last_solutions[t_sub_problem_id] = std::move(current_solution);

return has_changed;
}
Expand Down

0 comments on commit 780b27c

Please sign in to comment.