mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
reverse the order of vars for pdd_grobner, use pdd_grobner.reset()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
b5364b787c
commit
407c8a60db
3 changed files with 87 additions and 97 deletions
|
@ -259,7 +259,6 @@ namespace dd {
|
|||
void reset(unsigned_vector const& level2var);
|
||||
void set_max_num_nodes(unsigned n) { m_max_num_nodes = n; }
|
||||
unsigned_vector const& get_level2var() const { return m_level2var; }
|
||||
unsigned_vector& get_level2var() { return m_level2var; }
|
||||
|
||||
pdd mk_var(unsigned i);
|
||||
pdd mk_val(rational const& r);
|
||||
|
|
|
@ -1596,17 +1596,20 @@ void core::set_active_vars_weights(nex_creator& nc) {
|
|||
|
||||
void core::set_level2var_for_pdd_grobner() {
|
||||
unsigned n = m_pdd_manager.get_level2var().size();
|
||||
unsigned_vector level2var(n);
|
||||
unsigned_vector sorted_vars(n);
|
||||
for (unsigned j = 0; j < n; j++)
|
||||
level2var[j] = j;
|
||||
sorted_vars[j] = j;
|
||||
// sort that the larger weights are in beginning
|
||||
std::sort(level2var.begin(), level2var.end(), [this](unsigned a, unsigned b) {
|
||||
std::sort(sorted_vars.begin(), sorted_vars.end(), [this](unsigned a, unsigned b) {
|
||||
unsigned wa = get_var_weight(a);
|
||||
unsigned wb = get_var_weight(b);
|
||||
return wa > wb || (wa == wb && a > b); });
|
||||
unsigned_vector& l2v = m_pdd_manager.get_level2var();
|
||||
return wa < wb || (wa == wb && a < b); });
|
||||
|
||||
unsigned_vector l2v(n);
|
||||
for (unsigned j = 0; j < n; j++)
|
||||
l2v[j] = level2var[j];
|
||||
l2v[j] = sorted_vars[j];
|
||||
|
||||
m_pdd_manager.reset(l2v);
|
||||
}
|
||||
|
||||
unsigned core::get_var_weight(lpvar j) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue