1/*******************************************************************\
5Author: Daniel Kroening, kroening@kroening.com
7\*******************************************************************/
18 // make sure j, k are roots
23 return;
// already in same set
29 nodes[k].count+=
nodes[j].count;
// so k becomes parent to j
33 else // j is NOT the smaller
35 nodes[j].count+=
nodes[k].count;
// so j becomes parent to k
45 // is a itself a root?
62 // now it's not a root
76 // make sure old_root is a root
92 // the order here is important!
108 // Cannot find another node in a singleton set
111 // find a different member of the same set
148 // one-pass variant of path-compression:
149 // make every other node in path
150 // point to its grandparent.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
void intersection(const unsigned_union_find &other)
std::vector< nodet > nodes
void check_index(size_type a)
void re_root(size_type old, size_type new_root)
size_type find(size_type a) const
size_type count(size_type a) const
void swap(unsigned_union_find &other)
bool is_root(size_type a) const
size_type get_other(size_type a)
void make_union(size_type a, size_type b)
bool same_set(size_type a, size_type b) const
void isolate(size_type a)
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)