3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

change core::get_var_weight() to return unsigned, remove some warnings from test/lp/lp.cpp

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-12-28 13:19:20 -08:00
parent 1cc5935953
commit 0bb29bca69
4 changed files with 108 additions and 118 deletions

View file

@ -35,18 +35,6 @@ struct occ {
}
};
enum var_weight {
FIXED = 0,
QUOTED_FIXED = 1,
BOUNDED = 2,
QUOTED_BOUNDED = 3,
NOT_FREE = 4,
QUOTED_NOT_FREE = 5,
FREE = 6,
QUOTED_FREE = 7,
MAX_DEFAULT_WEIGHT = 7
};
// the purpose of this class is to create nex objects, keep them,
// sort them, and delete them

View file

@ -1593,28 +1593,30 @@ void core::set_active_vars_weights(nex_creator& nc) {
}
}
var_weight core::get_var_weight(lpvar j) const {
var_weight k;
unsigned core::get_var_weight(lpvar j) const {
unsigned k;
switch (m_lar_solver.get_column_type(j)) {
case lp::column_type::fixed:
k = var_weight::FIXED;
k = 0;
break;
case lp::column_type::boxed:
k = var_weight::BOUNDED;
k = 2;
break;
case lp::column_type::lower_bound:
case lp::column_type::upper_bound:
k = var_weight::NOT_FREE;
k = 4;
case lp::column_type::free_column:
k = var_weight::FREE;
k = 6;
break;
default:
UNREACHABLE();
break;
}
if (is_monic_var(j)) {
return (var_weight)((int)k + 1);
k++;
if (m_to_refine.contains(j))
k++;
}
return k;
}

View file

@ -399,7 +399,7 @@ public:
std::unordered_set<lpvar> get_vars_of_expr_with_opening_terms(const nex* e);
void display_matrix_of_m_rows(std::ostream & out) const;
void set_active_vars_weights(nex_creator&);
var_weight get_var_weight(lpvar) const;
unsigned get_var_weight(lpvar) const;
void add_row_to_pdd_grobner(const vector<lp::row_cell<rational>> & row);
void check_pdd_eq(const dd::grobner::equation*);
void create_vars_used_in_mrows();