Skip to content

Commit f680242

Browse files
committed
adjust the frequency of dio calls
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 15a3818 commit f680242

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/math/lp/dioph_eq.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,15 +2085,6 @@ namespace lp {
20852085
}
20862086
while (ret == lia_move::continue_with_check);
20872087

2088-
if (ret != lia_move::undef)
2089-
return ret;
2090-
if (ret == lia_move::undef) {
2091-
lra.settings().dio_calls_period() *= 2;
2092-
if (lra.settings().dio_calls_period() >= 16) {
2093-
lra.settings().dio_enable_gomory_cuts() = true;
2094-
lra.settings().set_run_gcd_test(true);
2095-
}
2096-
}
20972088
return ret;
20982089
}
20992090

src/math/lp/int_solver.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ namespace lp {
4343
unsigned m_hnf_cut_period;
4444
dioph_eq m_dio;
4545
int_gcd_test m_gcd;
46-
46+
unsigned m_initial_dio_calls_period;
47+
4748
bool column_is_int_inf(unsigned j) const {
4849
return lra.column_is_int(j) && (!lia.value_is_int(j));
4950
}
5051

5152
imp(int_solver& lia): lia(lia), lra(lia.lra), lrac(lia.lrac), m_hnf_cutter(lia), m_dio(lia), m_gcd(lia) {
5253
m_hnf_cut_period = settings().hnf_cut_period();
54+
m_initial_dio_calls_period = settings().dio_calls_period();
5355
}
5456

5557
bool has_lower(unsigned j) const {
@@ -173,8 +175,18 @@ namespace lp {
173175

174176
if (r == lia_move::conflict) {
175177
m_dio.explain(*this->m_ex);
178+
lia.settings().dio_calls_period() = m_initial_dio_calls_period;
179+
lia.settings().dio_enable_gomory_cuts() = false;
180+
lia.settings().set_run_gcd_test(false);
176181
return lia_move::conflict;
177-
}
182+
}
183+
if (r == lia_move::undef) {
184+
lia.settings().dio_calls_period() *= 2;
185+
if (lra.settings().dio_calls_period() >= 16) {
186+
lia.settings().dio_enable_gomory_cuts() = true;
187+
lia.settings().set_run_gcd_test(true);
188+
}
189+
}
178190
return r;
179191
}
180192

src/math/lp/lp_params_helper.pyg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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, 4, 'Period of calling the Diophantine handler in the final_check()'),
10+
('dio_calls_period', UINT, 1, 'Period of calling the Diophantine handler in the final_check()'),
1111
('dio_run_gcd', BOOL, False, 'Run the GCD heuristic if dio is on, if dio is disabled the option is not used'),
1212
))
1313

0 commit comments

Comments
 (0)