@@ -44,6 +44,7 @@ namespace lp {
4444 dioph_eq m_dio;
4545 int_gcd_test m_gcd;
4646 unsigned m_initial_dio_calls_period;
47+ unsigned m_patch_period = 1 ;
4748
4849 bool column_is_int_inf (unsigned j) const {
4950 return lra.column_is_int (j) && (!lia.value_is_int (j));
@@ -52,6 +53,7 @@ namespace lp {
5253 imp (int_solver& lia): lia(lia), lra(lia.lra), lrac(lia.lrac), m_hnf_cutter(lia), m_dio(lia), m_gcd(lia) {
5354 m_hnf_cut_period = settings ().hnf_cut_period ();
5455 m_initial_dio_calls_period = settings ().dio_calls_period ();
56+ m_patch_period = settings ().m_int_patch_period ;
5557 }
5658
5759 bool has_lower (unsigned j) const {
@@ -156,6 +158,11 @@ namespace lp {
156158 try_patch_column (v, c.var (), delta_plus);
157159 }
158160
161+ bool should_patch () {
162+ // period == 0 means no throttling (old behavior)
163+ return settings ().m_int_patch_period == 0 || m_number_of_calls % m_patch_period == 0 ;
164+ }
165+
159166 lia_move patch_basic_columns () {
160167 lia.settings ().stats ().m_patches ++;
161168 lra.remove_fixed_vars_from_base ();
@@ -165,8 +172,12 @@ namespace lp {
165172 patch_basic_column (j);
166173 if (!lra.has_inf_int ()) {
167174 lia.settings ().stats ().m_patches_success ++;
175+ m_patch_period = std::max (1u , settings ().m_int_patch_period );
168176 return lia_move::sat;
169177 }
178+ // Only throttle if enabled (period > 0)
179+ if (settings ().m_int_patch_period > 0 && m_patch_period < 16 )
180+ m_patch_period *= 2 ;
170181 return lia_move::undef;
171182 }
172183
@@ -244,7 +255,7 @@ namespace lp {
244255 return lia_move::undef;
245256
246257 ++m_number_of_calls;
247- if (r == lia_move::undef) r = patch_basic_columns ();
258+ if (r == lia_move::undef && should_patch () ) r = patch_basic_columns ();
248259 if (r == lia_move::undef && should_find_cube ()) r = int_cube (lia)();
249260 if (r == lia_move::undef) lra.move_non_basic_columns_to_bounds ();
250261 if (r == lia_move::undef && should_hnf_cut ()) r = hnf_cut ();
0 commit comments