mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	always call find_feasible_solution in move_nbasic_columns_to_bounds()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
		
							parent
							
								
									ba40a5752f
								
							
						
					
					
						commit
						f8037ffda4
					
				
					 2 changed files with 2 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue