Do not document registry and map defines.
4 #include <hugo/unionfind.h>
5 #include "test_tools.h"
11 class BaseMap : public StdMap<int,T> {};
13 typedef UnionFindEnum<int, BaseMap> UFE;
15 void print(UFE const &ufe) {
17 cout << "Print the classes of the structure:" << endl;
19 for (ufe.first(cit); ufe.valid(cit); ufe.next(cit)) {
20 cout << " " << i << " (" << cit << "):" << flush;
22 for (ufe.first(iit, cit); ufe.valid(iit); ufe.next(iit)) {
23 cout << " " << iit << flush;
28 cout << "done" << endl;
38 cout << "Insert 1..." << endl;
42 cout << "Insert 2..." << endl;
46 cout << "Join 1 and 2..." << endl;
47 check(U.join(1,2),"Test failed.");
50 cout << "Insert 3, 4, 5, 6, 7..." << endl;
58 cout << "Join 1 - 4, 2 - 4 and 3 - 5 ..." << endl;
59 check(U.join(1,4),"Test failed.");
60 check(!U.join(2,4),"Test failed.");
61 check(U.join(3,5),"Test failed.");
64 cout << "Insert 8 to the component of 5 ..." << endl;
68 cout << "Size of the class of 4: " << U.size(4) << endl;
69 check(U.size(4) == 3,"Test failed.");
70 cout << "Size of the class of 5: " << U.size(5) << endl;
71 check(U.size(5) == 3,"Test failed.");
72 cout << "Size of the class of 6: " << U.size(6) << endl;
73 check(U.size(6) == 1,"Test failed.");
74 cout << "Size of the class of 2: " << U.size(2) << endl;
75 check(U.size(2) == 3,"Test failed.");
77 cout << "Insert 9 ..." << endl;
80 cout << "Insert 10 to the component of 9 ..." << endl;
84 cout << "Join 8 and 10..." << endl;
85 check(U.join(8,10),"Test failed.");
88 cout << "Move 9 to the class of 4 ..." << endl;
89 check(U.move(9,4),"Test failed.");
92 cout << "Move 9 to the class of 2 ..." << endl;
93 check(!U.move(9,2),"Test failed.");
96 cout << "Size of the class of 4: " << U.size(4) << endl;
97 check(U.size(4) == 4,"Test failed.");
98 cout << "Size of the class of 9: " << U.size(9) << endl;
99 check(U.size(9) == 4,"Test failed.");
101 cout << "Move 5 to the class of 6 ..." << endl;
102 check(U.move(5,6),"Test failed.");
105 cout << "Size of the class of 5: " << U.size(5) << endl;
106 check(U.size(5) == 2,"Test failed.");
107 cout << "Size of the class of 8: " << U.size(8) << endl;
108 check(U.size(8) == 3,"Test failed.");
110 cout << "Move 7 to the class of 10 ..." << endl;
111 check(U.move(7,10),"Test failed.");
114 cout << "Size of the class of 7: " << U.size(7) << endl;
115 check(U.size(7) == 4,"Test failed.");
117 cout <<"Erase 9... " << endl;
121 cout <<"Erase 1... " << endl;
125 cout << "Size of the class of 4: " << U.size(4) << endl;
126 check(U.size(4) == 2,"Test failed.");
127 cout << "Size of the class of 2: " << U.size(2) << endl;
128 check(U.size(2) == 2,"Test failed.");
131 cout <<"Erase 1... " << endl;
135 cout <<"Erase 6... " << endl;
139 cout << "Split the class of 8... " << endl;
144 cout << "Size of the class of 4: " << U.size(4) << endl;
145 check(U.size(4) == 2,"Test failed.");
146 cout << "Size of the class of 3: " << U.size(3) << endl;
147 check(U.size(3) == 1,"Test failed.");
148 cout << "Size of the class of 2: " << U.size(2) << endl;
149 check(U.size(2) == 2,"Test failed.");
152 cout << "Join 3 - 4 and 2 - 4 ..." << endl;
153 check(U.join(3,4),"Test failed.");
154 check(!U.join(2,4),"Test failed.");
158 cout << "Size of the class of 4: " << U.size(4) << endl;
159 check(U.size(4) == 3,"Test failed.");
160 cout << "Size of the class of 3: " << U.size(3) << endl;
161 check(U.size(3) == 3,"Test failed.");
162 cout << "Size of the class of 2: " << U.size(2) << endl;
163 check(U.size(2) == 3,"Test failed.");
165 cout << "Calling makeRep(4)..." << endl;
168 cout << "Calling makeRep(3)..." << endl;
171 cout << "Calling makeRep(2)..." << endl;
175 cout << "Size of the class of 4: " << U.size(4) << endl;
176 check(U.size(4) == 3,"Test failed.");
177 cout << "Size of the class of 3: " << U.size(3) << endl;
178 check(U.size(3) == 3,"Test failed.");
179 cout << "Size of the class of 2: " << U.size(2) << endl;
180 check(U.size(2) == 3,"Test failed.");
183 cout << "eraseClass 4 ..." << endl;
187 cout << "eraseClass 7 ..." << endl;
191 cout << "done." << endl;