Skip to content

Commit d4ba75e

Browse files
committedApr 5, 2025·
add parameter m_dio_calls_period
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 9cf5665 commit d4ba75e

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed
 

Diff for: ‎src/math/lp/dioph_eq.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,8 @@ namespace lp {
23332333
ret = branching_on_undef();
23342334

23352335
m_max_of_branching_iterations = (unsigned)m_max_of_branching_iterations / 2;
2336+
if (ret == lia_move::undef)
2337+
lra.settings().dio_calls_period() *= 2;
23362338
return ret;
23372339
}
23382340

Diff for: ‎src/math/lp/int_solver.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ namespace lp {
4141
mpq m_k; // the right side of the cut
4242
hnf_cutter m_hnf_cutter;
4343
unsigned m_hnf_cut_period;
44-
unsigned m_dioph_eq_period;
4544
dioph_eq m_dio;
4645
int_gcd_test m_gcd;
4746

@@ -51,7 +50,6 @@ namespace lp {
5150

5251
imp(int_solver& lia): lia(lia), lra(lia.lra), lrac(lia.lrac), m_hnf_cutter(lia), m_dio(lia), m_gcd(lia) {
5352
m_hnf_cut_period = settings().hnf_cut_period();
54-
m_dioph_eq_period = settings().m_dioph_eq_period;
5553
}
5654

5755
bool has_lower(unsigned j) const {
@@ -193,7 +191,7 @@ namespace lp {
193191
}
194192

195193
bool should_solve_dioph_eq() {
196-
return lia.settings().dio_eqs() && m_number_of_calls % m_dioph_eq_period == 0;
194+
return lia.settings().dio_eqs() && (m_number_of_calls % settings().dio_calls_period() == 0);
197195
}
198196

199197
// HNF

Diff for: ‎src/math/lp/lp_params_helper.pyg

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ def_module_params(module_name='lp',
77
('dio_cuts_enable_gomory', BOOL, False, 'enable Gomory cuts together with Diophantine cuts, only relevant when dioph_eq is true'),
88
('dio_cuts_enable_hnf', BOOL, True, 'enable hnf cuts together with Diophantine cuts, only relevant when dioph_eq is true'),
99
('dio_ignore_big_nums', BOOL, True, 'Ignore the terms with big numbers in the Diophantine handler, only relevant when dioph_eq is true'),
10+
('dio_calls_period', UINT, 1, 'Period of calling the Diophantine handler in the final_check()'),
1011
))
1112

Diff for: ‎src/math/lp/lp_settings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ void lp::lp_settings::updt_params(params_ref const& _p) {
3939
m_dio_enable_hnf_cuts = lp_p.dio_cuts_enable_hnf();
4040
m_dio_branching_period = lp_p.dio_branching_period();m_dump_bound_lemmas = p.arith_dump_bound_lemmas();
4141
m_dio_ignore_big_nums = lp_p.dio_ignore_big_nums();
42+
m_dio_calls_period = lp_p.dio_calls_period();
4243
}

Diff for: ‎src/math/lp/lp_settings.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ struct lp_settings {
243243
unsigned column_number_threshold_for_using_lu_in_lar_solver = 4000;
244244
unsigned m_int_gomory_cut_period = 4;
245245
unsigned m_int_find_cube_period = 4;
246-
unsigned m_dioph_eq_period = 1;
247246
private:
248247
unsigned m_hnf_cut_period = 4;
249248
bool m_int_run_gcd_test = true;
@@ -262,8 +261,11 @@ struct lp_settings {
262261
unsigned m_dio_report_branch_with_term_tigthening_period = 10000000; // period of reporting the branch with term tigthening
263262
bool m_dump_bound_lemmas = false;
264263
bool m_dio_ignore_big_nums = false;
264+
unsigned m_dio_calls_period = 1;
265265

266266
public:
267+
unsigned dio_calls_period() const { return m_dio_calls_period; }
268+
unsigned & dio_calls_period() { return m_dio_calls_period; }
267269
bool print_external_var_name() const { return m_print_external_var_name; }
268270
bool propagate_eqs() const { return m_propagate_eqs;}
269271
unsigned hnf_cut_period() const { return m_hnf_cut_period; }

0 commit comments

Comments
 (0)
Please sign in to comment.