@@ -519,8 +519,8 @@ struct create_cut {
519
519
lia_move gomory::get_gomory_cuts (unsigned num_cuts) {
520
520
struct cut_result {u_dependency *dep; lar_term t; mpq k; int polarity; lpvar j;};
521
521
vector<cut_result> big_cuts;
522
- struct polar_pair { int polarity; u_dependency *dep;};
523
- std::unordered_map<lpvar, polar_pair > polar_vars;
522
+ struct polar_info {lpvar j; int polarity; u_dependency *dep;};
523
+ vector<polar_info > polar_vars;
524
524
unsigned_vector columns_for_cuts = gomory_select_int_infeasible_vars (num_cuts);
525
525
526
526
// define inline helper functions
@@ -556,7 +556,7 @@ struct create_cut {
556
556
continue ;
557
557
cut_result cr = {cc.m_dep , lia.m_t , lia.m_k , cc.m_polarity , j};
558
558
if (abs (cr.polarity ) == 1 ) // need to delay the update of the bounds for j in a polar case, because simplify_inequality relies on the old bounds
559
- polar_vars[j] = { cr.polarity , cc.m_dep };
559
+ polar_vars. push_back ( {j, cr.polarity , cc.m_dep } ) ;
560
560
561
561
if (!is_small_cut (lia.m_t )) {
562
562
big_cuts.push_back (cr);
@@ -584,12 +584,12 @@ struct create_cut {
584
584
585
585
// this way we create bounds for the variables in polar cases even where the terms had big numbers
586
586
for (auto const & p : polar_vars) {
587
- if (p.second . polarity == 1 ) {
588
- lra.update_column_type_and_bound (p.first , lp::lconstraint_kind::LE, floor (lra.get_column_value (p.first ).x ), p. second .dep );
587
+ if (p.polarity == 1 ) {
588
+ lra.update_column_type_and_bound (p.j , lp::lconstraint_kind::LE, floor (lra.get_column_value (p.j ).x ), p.dep );
589
589
}
590
590
else {
591
- SASSERT (p.second . polarity == -1 );
592
- lra.update_column_type_and_bound (p.first , lp::lconstraint_kind::GE, ceil (lra.get_column_value (p.first ).x ), p. second .dep );
591
+ SASSERT (p.polarity == -1 );
592
+ lra.update_column_type_and_bound (p.j , lp::lconstraint_kind::GE, ceil (lra.get_column_value (p.j ).x ), p.dep );
593
593
}
594
594
}
595
595
0 commit comments