mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 12:53:38 +00:00
Add method to (explicitly) re-assign the pdd manager
This commit is contained in:
parent
2795ac5e90
commit
129039dc52
2 changed files with 9 additions and 0 deletions
|
@ -1825,6 +1825,14 @@ namespace dd {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reset pdd to 0. Allows re-assigning the pdd manager. */
|
||||||
|
void pdd::reset(pdd_manager& new_m) {
|
||||||
|
m->dec_ref(root);
|
||||||
|
root = 0;
|
||||||
|
m = &new_m;
|
||||||
|
SASSERT(is_zero());
|
||||||
|
}
|
||||||
|
|
||||||
rational const& pdd::leading_coefficient() const {
|
rational const& pdd::leading_coefficient() const {
|
||||||
pdd p = *this;
|
pdd p = *this;
|
||||||
while (!p.is_val())
|
while (!p.is_val())
|
||||||
|
|
|
@ -413,6 +413,7 @@ namespace dd {
|
||||||
pdd& operator=(rational const& k);
|
pdd& operator=(rational const& k);
|
||||||
// TODO: pdd& operator=(pdd&& other); (just swap like move constructor?)
|
// TODO: pdd& operator=(pdd&& other); (just swap like move constructor?)
|
||||||
~pdd() { m->dec_ref(root); }
|
~pdd() { m->dec_ref(root); }
|
||||||
|
void reset(pdd_manager& new_m);
|
||||||
pdd lo() const { return pdd(m->lo(root), m); }
|
pdd lo() const { return pdd(m->lo(root), m); }
|
||||||
pdd hi() const { return pdd(m->hi(root), m); }
|
pdd hi() const { return pdd(m->hi(root), m); }
|
||||||
unsigned index() const { return root; }
|
unsigned index() const { return root; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue