3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

working on pb

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-02-26 09:06:25 -08:00
parent 54e3b5ee0d
commit 3757f337e5
5 changed files with 9 additions and 5 deletions

View file

@ -59,9 +59,11 @@ namespace simplex {
struct stats {
unsigned m_num_pivots;
unsigned m_num_infeasible;
unsigned m_num_checks;
stats() { reset(); }
void reset() {
memset(this, sizeof(*this), 0);
memset(this, 0, sizeof(*this));
}
};

View file

@ -250,6 +250,7 @@ namespace simplex {
template<typename Ext>
lbool simplex<Ext>::make_feasible() {
++m_stats.m_num_checks;
m_left_basis.reset();
m_infeasible_var = null_var;
unsigned num_iterations = 0;
@ -266,6 +267,7 @@ namespace simplex {
if (!make_var_feasible(v)) {
m_to_patch.insert(v);
m_infeasible_var = v;
++m_stats.m_num_infeasible;
return l_false;
}
++num_iterations;
@ -873,6 +875,8 @@ namespace simplex {
void simplex<Ext>::collect_statistics(::statistics & st) const {
M.collect_statistics(st);
st.update("simplex num pivots", m_stats.m_num_pivots);
st.update("simplex num infeasible", m_stats.m_num_infeasible);
st.update("simplex num checks", m_stats.m_num_checks);
}

View file

@ -44,7 +44,7 @@ namespace simplex {
unsigned m_add_rows;
stats() { reset(); }
void reset() {
memset(this, sizeof(*this), 0);
memset(this, 0, sizeof(*this));
}
};