From 2ac866a8d088b73d5310051ffc31ca909fa1162a Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Thu, 11 Jan 2024 12:10:37 -1000 Subject: [PATCH] take the coefficient from cut_result, not lia Signed-off-by: Lev Nachmanson --- src/math/lp/gomory.cpp | 3 +-- src/math/lp/lar_solver.h | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/math/lp/gomory.cpp b/src/math/lp/gomory.cpp index cefd9767ffb..167725d315f 100644 --- a/src/math/lp/gomory.cpp +++ b/src/math/lp/gomory.cpp @@ -410,12 +410,11 @@ struct create_cut { return all_of(t, [&](auto ci) { return ci.coeff().is_small(); }); }; auto add_cut = [&](cut_result const& cr) { - u_dependency* dep = cr.dep; lp::lpvar term_index = lra.add_term(cr.t.coeffs_as_vector(), UINT_MAX); term_index = lra.map_term_index_to_column_index(term_index); lra.update_column_type_and_bound(term_index, lp::lconstraint_kind::GE, - lia.m_k, dep); + cr.k, cr.dep); }; auto _check_feasible = [&](void) { lra.find_feasible_solution(); diff --git a/src/math/lp/lar_solver.h b/src/math/lp/lar_solver.h index a01a66a3813..91d506e1e85 100644 --- a/src/math/lp/lar_solver.h +++ b/src/math/lp/lar_solver.h @@ -562,7 +562,9 @@ class lar_solver : public column_namer { std::ostream& print_implied_bound(const implied_bound& be, std::ostream& out) const; std::ostream& print_values(std::ostream& out) const; std::ostream& display(std::ostream& out) const; - + std::ostream& display_constraint(std::ostream& out, constraint_index ci) const { + return m_constraints.display(out, ci); + } bool init_model() const; mpq from_model_in_impq_to_mpq(const impq& v) const { return v.x + m_delta * v.y; } mpq get_value(column_index const& j) const;