@@ -400,8 +400,6 @@ struct create_cut {
400
400
lia_move gomory::get_gomory_cuts (unsigned num_cuts) {
401
401
struct cut_result {u_dependency *dep; lar_term t; mpq k; int polarity; lpvar j;};
402
402
vector<cut_result> big_cuts;
403
- struct polar_info {lpvar j; int polarity; u_dependency *dep;};
404
- vector<polar_info> polar_vars;
405
403
unsigned_vector columns_for_cuts = gomory_select_int_infeasible_vars (num_cuts);
406
404
bool has_small_cut = false ;
407
405
@@ -437,10 +435,14 @@ struct create_cut {
437
435
return lia_move::conflict;
438
436
continue ;
439
437
}
438
+
439
+ if (cc.m_polarity == 1 )
440
+ lra.update_column_type_and_bound (j, lp::lconstraint_kind::LE, floor (lra.get_column_value (j).x ), cc.m_dep );
441
+ else if (cc.m_polarity == -1 )
442
+ lra.update_column_type_and_bound (j, lp::lconstraint_kind::GE, ceil (lra.get_column_value (j).x ), cc.m_dep );
443
+
444
+
440
445
cut_result cr = {cc.m_dep , lia.m_t , lia.m_k , cc.m_polarity , j};
441
- 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
442
- polar_vars.push_back ( {j, cr.polarity , cc.m_dep } );
443
-
444
446
if (!is_small_cut (lia.m_t )) {
445
447
big_cuts.push_back (cr);
446
448
continue ;
@@ -463,17 +465,6 @@ struct create_cut {
463
465
add_cut (cut);
464
466
465
467
}
466
-
467
- // this way we create bounds for the variables in polar cases even where the terms have big numbers
468
- for (auto const & p : polar_vars) {
469
- if (p.polarity == 1 ) {
470
- lra.update_column_type_and_bound (p.j , lp::lconstraint_kind::LE, floor (lra.get_column_value (p.j ).x ), p.dep );
471
- }
472
- else {
473
- SASSERT (p.polarity == -1 );
474
- lra.update_column_type_and_bound (p.j , lp::lconstraint_kind::GE, ceil (lra.get_column_value (p.j ).x ), p.dep );
475
- }
476
- }
477
468
478
469
if (!_check_feasible ())
479
470
return lia_move::conflict;
0 commit comments