Skip to content

Commit

Permalink
return an empty model when the status of the solver is neither FEASIB…
Browse files Browse the repository at this point in the history
…LE nor OPTIMAL

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
  • Loading branch information
levnach committed Apr 16, 2020
1 parent cb4ceea commit 6d8e540
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/math/lp/lar_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,11 @@ void lar_solver::get_infeasibility_explanation_for_inf_sign(

// (x, y) != (x', y') => (x + delta*y) != (x' + delta*y')
void lar_solver::get_model(std::unordered_map<var_index, mpq> & variable_values) const {
lp_assert(get_status() == lp_status::OPTIMAL || get_status() == lp_status::FEASIBLE);
if (!(get_status() == lp_status::OPTIMAL || get_status() == lp_status::FEASIBLE)) {
variable_values.clear();
return;
}

lp_assert(m_mpq_lar_core_solver.m_r_solver.calc_current_x_is_feasible_include_non_basis());
variable_values.clear();
mpq delta = m_mpq_lar_core_solver.find_delta_for_strict_bounds(mpq(1, 2)); // start from 0.5 to have less clashes
Expand Down

0 comments on commit 6d8e540

Please sign in to comment.