3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-04-27 15:26:56 -07:00
parent a71b4fab23
commit e5892e5e97
4 changed files with 25 additions and 3 deletions

View file

@ -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) {