Changeset 987:87f7c54892df in lemon-0.x for src/work/athos/union_find.h
- Timestamp:
- 11/13/04 18:07:10 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/union_find.h
r921 r987 16 16 namespace lemon { 17 17 18 template <typename Key Type, typename KeyIntMap>18 template <typename Key, typename KeyIntMap> 19 19 class UnionFind { 20 20 KeyIntMap& pointmap; … … 35 35 36 36 //Give a component of one point to the structure 37 int addPoint(Key Typeu){37 int addPoint(Key u){ 38 38 int _index = container.size(); 39 39 VectorElementType buf(_index,1); … … 44 44 45 45 //Finds the big boss of u 46 int find(Key Typeu){46 int find(Key u){ 47 47 if (pointmap.get(u)==-1){ 48 48 int whoami = addPoint(u); … … 62 62 63 63 //Finds u and v in the structures and merges the comopnents, if not equal 64 bool findAndMerge(Key Type u,KeyTypev){64 bool findAndMerge(Key u,Key v){ 65 65 int bu = find(u); 66 66 int bv = find(v);
Note: See TracChangeset
for help on using the changeset viewer.