Skip to content

Commit

Permalink
Fix gap contribution bug (#722)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Bittar <thomas.bittar@rte-france.com>
(cherry picked from commit 9eaff46)
  • Loading branch information
tbittar authored and JasonMarechal25 committed Dec 5, 2023
1 parent ff84257 commit 725cdd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/benders/benders_by_batch/BendersByBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ void BendersByBatch::GetSubproblemCut(
subproblem_data.var_name_and_subgradient); // dual pi_s
auto subpb_cost_under_approx = GetAlpha_i()[ProblemToId(name)];
*batch_subproblems_costs_contribution_in_gap_per_proc +=
subproblem_data.subproblem_cost - subpb_cost_under_approx;
std::max(subproblem_data.subproblem_cost - subpb_cost_under_approx,
static_cast<double>(0));
double cut_value_at_x_cut = subproblem_data.subproblem_cost;
for (const auto &[candidate_name, x_cut_candidate_value] : _data.x_cut) {
auto subgradient_at_name =
Expand Down

0 comments on commit 725cdd3

Please sign in to comment.