Changeset 2205:c20b0eb92a33 in lemon-0.x for test/unionfind_test.cc
- Timestamp:
- 09/06/06 13:17:12 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2930
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/unionfind_test.cc
r2005 r2205 26 26 using namespace std; 27 27 28 template <typename T> 29 class BaseMap : public StdMap<int,T> {}; 30 31 typedef UnionFindEnum<int, BaseMap> UFE; 28 typedef UnionFindEnum<int, StdMap<int, int> > UFE; 32 29 33 30 void print(UFE const &ufe) { 34 UFE::ClassIt cit;35 31 cout << "Print the classes of the structure:" << endl; 36 32 int i = 1; 37 for ( ufe.first(cit); ufe.valid(cit); ufe.next(cit)) {33 for (UFE::ClassIt cit(ufe); cit != INVALID; ++cit) { 38 34 cout << " " << i << " (" << cit << "):" << flush; 39 UFE::ItemIt iit; 40 for (ufe.first(iit, cit); ufe.valid(iit); ufe.next(iit)) { 35 for (UFE::ItemIt iit(ufe, cit); iit != INVALID; ++iit) { 41 36 cout << " " << iit << flush; 42 37 } … … 49 44 50 45 int main() { 51 UFE::MapTypebase;46 StdMap<int, int> base; 52 47 UFE U(base); 53 48 … … 76 71 U.insert(9); 77 72 U.insert(10,9); 73 78 74 check(U.join(8,10),"Test failed."); 79 75
Note: See TracChangeset
for help on using the changeset viewer.