mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
parent
a71b4fab23
commit
e5892e5e97
4 changed files with 25 additions and 3 deletions
|
@ -134,6 +134,14 @@ public:
|
|||
CASSERT("union_find", check_invariant());
|
||||
}
|
||||
|
||||
void set_root(unsigned v, unsigned root) {
|
||||
TRACE("union_find", tout << "merging " << v << " " << root << "\n";);
|
||||
SASSERT(v != root);
|
||||
m_find[v] = root;
|
||||
m_size[root] += m_size[v];
|
||||
std::swap(m_next[root], m_next[v]);
|
||||
}
|
||||
|
||||
// dissolve equivalence class of v
|
||||
// this method cannot be used with backtracking.
|
||||
void dissolve(unsigned v) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue