Skip to content

Commit

Permalink
only add upper and lower multiplicity constraints when relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Nov 7, 2023
1 parent 3536003 commit 0ed9735
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/src/optimizers/dantzig-wolfe/Formulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,21 @@ void idol::DantzigWolfe::Formulation::add_aggregation_constraint(unsigned int t_

auto& env = m_master.env();

Ctr lower(env, GreaterOrEqual, t_lower_multiplicity);
m_master.add(lower);
m_generation_patterns[t_sub_problem_id].linear().set(lower, 1);
if (!equals(t_lower_multiplicity, 0., Tolerance::Feasibility) && !is_neg_inf(t_lower_multiplicity)) {

Ctr upper(env, LessOrEqual, t_upper_multiplicity);
m_master.add(upper);
m_generation_patterns[t_sub_problem_id].linear().set(upper, 1);
Ctr lower(env, GreaterOrEqual, t_lower_multiplicity);
m_master.add(lower);
m_generation_patterns[t_sub_problem_id].linear().set(lower, 1);

}

if (!is_pos_inf(t_upper_multiplicity)) {

Ctr upper(env, LessOrEqual, t_upper_multiplicity);
m_master.add(upper);
m_generation_patterns[t_sub_problem_id].linear().set(upper, 1);

}

}

Expand Down

0 comments on commit 0ed9735

Please sign in to comment.