17 explicit UnionFind(std::vector<std::shared_ptr<TipType>> seed);
22 void add(std::vector<std::shared_ptr<TipType>> seed);
24 std::shared_ptr<TipType>
find(std::shared_ptr<TipType> t1);
25 void quick_union(std::shared_ptr<TipType> t1, std::shared_ptr<TipType> t2);
26 bool connected(std::shared_ptr<TipType> t1, std::shared_ptr<TipType> t2);
32 std::map<std::shared_ptr<TipType>, std::shared_ptr<TipType>> edges;
34 std::shared_ptr<TipType> lookup(std::shared_ptr<TipType> t);
36 std::shared_ptr<TipType> get_parent(std::shared_ptr<TipType> t);
39 std::shared_ptr<TipType> smart_insert(std::shared_ptr<TipType> t);
44 std::ostream &print(std::ostream &out)
const;
Specialized implementation of a union-find data structure tailored to work with TipTypes wrapped in s...
Definition: UnionFind.h:14
std::shared_ptr< TipType > find(std::shared_ptr< TipType > t1)
Definition: UnionFind.cpp:81
void quick_union(std::shared_ptr< TipType > t1, std::shared_ptr< TipType > t2)
Definition: UnionFind.cpp:98
friend std::ostream & operator<<(std::ostream &os, const UnionFind &obj)
Definition: UnionFind.cpp:61
bool connected(std::shared_ptr< TipType > t1, std::shared_ptr< TipType > t2)
Definition: UnionFind.cpp:123
void add(std::vector< std::shared_ptr< TipType >> seed)
add additional types to the union find structure
Definition: UnionFind.cpp:54