From f8037ffda4d96bf7b61f4597416209768b9c2d74 Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Mon, 27 Apr 2020 15:29:09 -0700 Subject: [PATCH] always call find_feasible_solution in move_nbasic_columns_to_bounds() Signed-off-by: Lev Nachmanson --- src/math/lp/int_cube.cpp | 2 +- src/math/lp/lar_solver.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/math/lp/int_cube.cpp b/src/math/lp/int_cube.cpp index fbd5065c2..49398bb7a 100644 --- a/src/math/lp/int_cube.cpp +++ b/src/math/lp/int_cube.cpp @@ -35,6 +35,7 @@ namespace lp { lra.push(); if (!tighten_terms_for_cube()) { lra.pop(); + lra.set_status(lp_status::OPTIMAL); return lia_move::undef; } @@ -42,7 +43,6 @@ namespace lp { if (st != lp_status::FEASIBLE && st != lp_status::OPTIMAL) { TRACE("cube", tout << "cannot find a feasiblie solution";); lra.pop(); - lra.set_status(lp_status::OPTIMAL); lra.move_non_basic_columns_to_bounds(); // it can happen that we found an integer solution here return !lra.r_basis_has_inf_int()? lia_move::sat: lia_move::undef; diff --git a/src/math/lp/lar_solver.cpp b/src/math/lp/lar_solver.cpp index 2f870d39d..bdaf32e88 100644 --- a/src/math/lp/lar_solver.cpp +++ b/src/math/lp/lar_solver.cpp @@ -465,14 +465,9 @@ void lar_solver::prepare_costs_for_r_solver(const lar_term & term) { lp_assert(rslv.reduced_costs_are_correct_tableau()); } -bool feasible(lp_status st) { - return st == lp_status::FEASIBLE || st == lp_status::OPTIMAL; -} - void lar_solver::move_non_basic_columns_to_bounds() { auto & lcs = m_mpq_lar_core_solver; bool change = false; - bool feas = feasible(get_status()); for (unsigned j : lcs.m_r_nbasis) { if (move_non_basic_column_to_bounds(j)) change = true; @@ -481,9 +476,8 @@ void lar_solver::move_non_basic_columns_to_bounds() { if (settings().simplex_strategy() == simplex_strategy_enum::tableau_costs && change) update_x_and_inf_costs_for_columns_with_changed_bounds_tableau(); - if (feas && change) { + if (change) { find_feasible_solution(); - SASSERT(feasible(get_status())); } }