A bool Edge Map with iterators that goes through the true or the false edges.
11 typedef StdMap<int,int> BaseMap;
12 typedef IterableMap<BaseMap, N> TestMap;
15 void print(TestMap const& m) {
16 cout << "Size of the map: " << m.size() << endl;
17 for(int i=0; i<N; ++i) {
18 cout << " Class " << i << ". (size=" << m.size(i) << "): " << flush;
20 for(TestMap::iterator j = m.begin(i); j!=m.end(i); ++j) {
37 cout << "Inserting 12 to class 2...\n";
42 cout << "Inserting 22 to class 2...\n";
46 cout << "Testing some map values:\n";
47 cout << " 12: " << int(test[12]) << endl;
49 cout << "Inserting 10 to class 0...\n";
53 cout << "Testing some map values:\n";
54 cout << " 12: " << int(test[12]) << endl;
56 cout << "Inserting 11 to class 1...\n";
60 cout << "Testing some map values:\n";
61 cout << " 12: " << int(test[12]) << endl;
62 cout << " 22: " << int(test[22]) << endl;
63 cout << " 10: " << int(test[10]) << endl;
64 cout << " 11: " << int(test[11]) << endl;
65 cout << " 42: " << int(test[42]) << endl;
67 cout << "Inserting 21 to class 1...\n";
71 cout << "Inserting 20 to class 1...\n";
75 cout << "Testing some map values:\n";
76 cout << " 12: " << int(test[12]) << endl;
77 cout << " 22: " << int(test[22]) << endl;
78 cout << " 10: " << int(test[10]) << endl;
79 cout << " 20: " << int(test[20]) << endl;
80 cout << " 11: " << int(test[11]) << endl;
81 cout << " 21: " << int(test[21]) << endl;
82 cout << " 42: " << int(test[42]) << endl;
84 cout << "Setting 20 to class 2...\n";
88 cout << "Setting 10 to class 1...\n";
92 cout << "Setting 11 to class 1...\n";
96 cout << "Setting 12 to class 1...\n";
100 cout << "Setting 21 to class 2...\n";
104 cout << "Setting 22 to class 2...\n";
108 cout << "Testing some map values:\n";
109 cout << " 12: " << int(test[12]) << endl;
110 cout << " 22: " << int(test[22]) << endl;
111 cout << " 10: " << int(test[10]) << endl;
112 cout << " 20: " << int(test[20]) << endl;
113 cout << " 11: " << int(test[11]) << endl;
114 cout << " 21: " << int(test[21]) << endl;
115 cout << " 42: " << int(test[42]) << endl;