@@ -139,7 +139,41 @@ namespace lp {
139139                return  solver.get_status () == lp_status::INFEASIBLE;
140140            }
141141        }
142-     };
142+         void  require_nbasis_sort () { m_mpq_lar_core_solver.m_r_solver .m_nbasis_sort_counter  = 0 ; }   
143+         void  register_in_fixed_var_table (unsigned  j, unsigned & equal_to_j) {
144+             SASSERT (lra.column_is_fixed (j));
145+             equal_to_j = null_lpvar;
146+             const  impq& bound = lra.get_lower_bound (j);
147+             if  (!bound.y .is_zero ())
148+                 return ;
149+             
150+             const  mpq& key = bound.x ;
151+             unsigned  k;
152+             bool  j_is_int = lra.column_is_int (j);
153+             if  (j_is_int) {
154+                 if  (!m_fixed_var_table_int.find (key, k)) {
155+                     m_fixed_var_table_int.insert (key, j);
156+                     return ;
157+                 }
158+             }
159+             else  { //  j is not integral column        
160+                 if  (!m_fixed_var_table_real.find (key, k)) {
161+                 m_fixed_var_table_real.insert (key, j);
162+                 return ;
163+             }
164+             }
165+ 
166+             CTRACE (" arith"  , !lra.column_is_fixed (k), lra.print_terms (tout););
167+             //  SASSERT(column_is_fixed(k));
168+             if  (j != k && lra.column_is_fixed (k)) {
169+                 SASSERT (lra.column_is_int (j) == lra.column_is_int (k));
170+                 equal_to_j = k;
171+                 TRACE (" lar_solver"  , tout << " found equal column k = "   << k <<
172+                       " , external = "   << equal_to_j << " \n "  ;);
173+             }
174+         }
175+         
176+     }; //  imp
143177    unsigned_vector& lar_solver::row_bounds_to_replay () { return  m_imp->m_row_bounds_to_replay ; }
144178
145179    trail_stack& lar_solver::trail () { return  m_imp->m_trail ; }
@@ -211,8 +245,6 @@ namespace lp {
211245
212246    indexed_uint_set& lar_solver::basic_columns_with_changed_cost () { return  m_imp->m_basic_columns_with_changed_cost ; }
213247
214-     void  lar_solver::require_nbasis_sort () { m_imp->m_mpq_lar_core_solver .m_r_solver .m_nbasis_sort_counter  = 0 ; }   
215- 
216248    mpq lar_solver::bound_span_x (lpvar j) const  {
217249        SASSERT (column_has_upper_bound (j) && column_has_lower_bound (j));
218250        return  get_upper_bound (j).x  - get_lower_bound (j).x ;
@@ -533,7 +565,7 @@ namespace lp {
533565        m_imp->m_usage_in_terms .pop (k);
534566        m_imp->m_dependencies .pop_scope (k);
535567        //  init the nbasis sorting
536- 		 require_nbasis_sort ();
568+         m_imp-> require_nbasis_sort ();
537569        set_status (lp_status::UNKNOWN);
538570    }
539571
@@ -759,7 +791,7 @@ namespace lp {
759791        TRACE (" lar_solver"  , print_term (term, tout << " maximize: "  ) << " \n " 
760792                                                                   << constraints () << " , strategy = "   << (int )settings ().simplex_strategy () << " \n "  ;);
761793        if  (settings ().simplex_strategy () != simplex_strategy_enum::tableau_costs)
762-             require_nbasis_sort ();
794+             m_imp-> require_nbasis_sort ();
763795        flet f (settings ().simplex_strategy (), simplex_strategy_enum::tableau_costs);
764796        prepare_costs_for_r_solver (term);
765797        ret = maximize_term_on_tableau (term, term_max);
@@ -1962,7 +1994,7 @@ namespace lp {
19621994        else  {
19631995            get_core_solver ().m_r_heading .push_back (-static_cast <int >(get_core_solver ().m_r_nbasis .size ()) - 1 );
19641996            get_core_solver ().m_r_nbasis .push_back (j);
1965-             require_nbasis_sort ();
1997+             m_imp-> require_nbasis_sort ();
19661998        }
19671999    }
19682000
@@ -2099,38 +2131,6 @@ namespace lp {
20992131        remove_non_fixed_from_table (m_imp->m_fixed_var_table_real );
21002132    }
21012133
2102-     void  lar_solver::register_in_fixed_var_table (unsigned  j, unsigned & equal_to_j) {
2103-         SASSERT (column_is_fixed (j));
2104-         equal_to_j = null_lpvar;
2105-         const  impq& bound = get_lower_bound (j);
2106-         if  (!bound.y .is_zero ())
2107-             return ;
2108- 
2109-         const  mpq& key = bound.x ;
2110-         unsigned  k;
2111-         bool  j_is_int = column_is_int (j);
2112-         if  (j_is_int) {
2113-             if  (!m_imp->m_fixed_var_table_int .find (key, k)) {
2114-                 m_imp->m_fixed_var_table_int .insert (key, j);
2115-                 return ;
2116-             }
2117-         }
2118-         else  { //  j is not integral column        
2119-             if  (!m_imp->m_fixed_var_table_real .find (key, k)) {
2120-                 m_imp->m_fixed_var_table_real .insert (key, j);
2121-                 return ;
2122-             }
2123-         }
2124- 
2125-         CTRACE (" arith"  , !column_is_fixed (k), print_terms (tout););
2126-         //  SASSERT(column_is_fixed(k));
2127-         if  (j != k && column_is_fixed (k)) {
2128-             SASSERT (column_is_int (j) == column_is_int (k));
2129-             equal_to_j = k;
2130-             TRACE (" lar_solver"  , tout << " found equal column k = "   << k <<
2131-                 " , external = "   << equal_to_j << " \n "  ;);
2132-         }
2133-     }
21342134
21352135    void  lar_solver::activate_check_on_equal (constraint_index ci, unsigned & equal_column) {
21362136        auto  const & c = m_imp->m_constraints [ci];
@@ -2318,7 +2318,7 @@ namespace lp {
23182318        update_column_type_and_bound (j, right_side, constr_index);
23192319        equal_to_j = null_lpvar;
23202320        if  (column_is_fixed (j)) {
2321-             register_in_fixed_var_table (j, equal_to_j);
2321+             m_imp-> register_in_fixed_var_table (j, equal_to_j);
23222322        }
23232323    }
23242324
0 commit comments