Skip to content

Commit c591a7a

Browse files
committed
force int bound on int columns, call term_is_int() after subst
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 4f75153 commit c591a7a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/math/lp/lar_solver.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -1641,12 +1641,12 @@ namespace lp {
16411641
var_index lar_solver::add_term(const vector<std::pair<mpq, var_index>>& coeffs, unsigned ext_i) {
16421642
TRACE("lar_solver_terms", print_linear_combination_of_column_indices_only(coeffs, tout) << ", ext_i =" << ext_i << "\n";);
16431643
SASSERT(!m_var_register.external_is_used(ext_i));
1644-
m_term_register.add_var(ext_i, term_is_int(coeffs));
1645-
lp_assert(all_vars_are_registered(coeffs));
1646-
if (strategy_is_undecided())
1647-
return add_term_undecided(coeffs);
1644+
SASSERT(all_vars_are_registered(coeffs));
16481645
lar_term* t = new lar_term(coeffs);
16491646
subst_known_terms(t);
1647+
m_term_register.add_var(ext_i, term_is_int(t));
1648+
if (strategy_is_undecided())
1649+
return add_term_undecided(coeffs);
16501650
push_term(t);
16511651
SASSERT(m_terms.size() == m_term_register.size());
16521652
unsigned adjusted_term_index = m_terms.size() - 1;
@@ -1938,10 +1938,11 @@ namespace lp {
19381938
tout << std::endl;
19391939
}
19401940
});
1941+
mpq rs = adjust_bound_for_int(j, kind, right_side);
19411942
if (column_has_upper_bound(j))
1942-
update_column_type_and_bound_with_ub(j, kind, right_side, dep);
1943+
update_column_type_and_bound_with_ub(j, kind, rs, dep);
19431944
else
1944-
update_column_type_and_bound_with_no_ub(j, kind, right_side, dep);
1945+
update_column_type_and_bound_with_no_ub(j, kind, rs, dep);
19451946

19461947
if (is_base(j) && column_is_fixed(j))
19471948
m_fixed_base_var_set.insert(j);

0 commit comments

Comments
 (0)