Skip to content

Commit f8037ff

Browse files
committed
always call find_feasible_solution in move_nbasic_columns_to_bounds()
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent ba40a57 commit f8037ff

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/math/lp/int_cube.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ namespace lp {
3535
lra.push();
3636
if (!tighten_terms_for_cube()) {
3737
lra.pop();
38+
lra.set_status(lp_status::OPTIMAL);
3839
return lia_move::undef;
3940
}
4041

4142
lp_status st = lra.find_feasible_solution();
4243
if (st != lp_status::FEASIBLE && st != lp_status::OPTIMAL) {
4344
TRACE("cube", tout << "cannot find a feasiblie solution";);
4445
lra.pop();
45-
lra.set_status(lp_status::OPTIMAL);
4646
lra.move_non_basic_columns_to_bounds();
4747
// it can happen that we found an integer solution here
4848
return !lra.r_basis_has_inf_int()? lia_move::sat: lia_move::undef;

src/math/lp/lar_solver.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,9 @@ void lar_solver::prepare_costs_for_r_solver(const lar_term & term) {
465465
lp_assert(rslv.reduced_costs_are_correct_tableau());
466466
}
467467

468-
bool feasible(lp_status st) {
469-
return st == lp_status::FEASIBLE || st == lp_status::OPTIMAL;
470-
}
471-
472468
void lar_solver::move_non_basic_columns_to_bounds() {
473469
auto & lcs = m_mpq_lar_core_solver;
474470
bool change = false;
475-
bool feas = feasible(get_status());
476471
for (unsigned j : lcs.m_r_nbasis) {
477472
if (move_non_basic_column_to_bounds(j))
478473
change = true;
@@ -481,9 +476,8 @@ void lar_solver::move_non_basic_columns_to_bounds() {
481476
if (settings().simplex_strategy() == simplex_strategy_enum::tableau_costs && change)
482477
update_x_and_inf_costs_for_columns_with_changed_bounds_tableau();
483478

484-
if (feas && change) {
479+
if (change) {
485480
find_feasible_solution();
486-
SASSERT(feasible(get_status()));
487481
}
488482
}
489483

0 commit comments

Comments
 (0)