Changes in / [821:072ec8120958:822:f903263902f6] in lemon-main
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/Makefile.am
r815 r822 111 111 lemon/pairing_heap.h \ 112 112 lemon/path.h \ 113 lemon/planarity.h \ 113 114 lemon/preflow.h \ 114 115 lemon/radix_heap.h \ -
lemon/bits/map_extender.h
r718 r802 85 85 typedef typename Map::Value Value; 86 86 87 MapIt() {}88 89 MapIt(Invalid i) : Parent(i) {}90 91 explicit MapIt(Map& _map) : map( _map) {92 map .notifier()->first(*this);87 MapIt() : map(NULL) {} 88 89 MapIt(Invalid i) : Parent(i), map(NULL) {} 90 91 explicit MapIt(Map& _map) : map(&_map) { 92 map->notifier()->first(*this); 93 93 } 94 94 95 95 MapIt(const Map& _map, const Item& item) 96 : Parent(item), map(&_map) {} 97 98 MapIt& operator++() { 99 map->notifier()->next(*this); 100 return *this; 101 } 102 103 typename MapTraits<Map>::ConstReturnValue operator*() const { 104 return (*map)[*this]; 105 } 106 107 typename MapTraits<Map>::ReturnValue operator*() { 108 return (*map)[*this]; 109 } 110 111 void set(const Value& value) { 112 map->set(*this, value); 113 } 114 115 protected: 116 Map* map; 117 118 }; 119 120 class ConstMapIt : public Item { 121 typedef Item Parent; 122 123 public: 124 125 typedef typename Map::Value Value; 126 127 ConstMapIt() : map(NULL) {} 128 129 ConstMapIt(Invalid i) : Parent(i), map(NULL) {} 130 131 explicit ConstMapIt(Map& _map) : map(&_map) { 132 map->notifier()->first(*this); 133 } 134 135 ConstMapIt(const Map& _map, const Item& item) 96 136 : Parent(item), map(_map) {} 97 137 98 MapIt& operator++() {99 map .notifier()->next(*this);138 ConstMapIt& operator++() { 139 map->notifier()->next(*this); 100 140 return *this; 101 141 } … … 105 145 } 106 146 107 typename MapTraits<Map>::ReturnValue operator*() { 108 return map[*this]; 109 } 110 111 void set(const Value& value) { 112 map.set(*this, value); 113 } 114 115 protected: 116 Map& map; 117 118 }; 119 120 class ConstMapIt : public Item { 121 typedef Item Parent; 122 123 public: 124 125 typedef typename Map::Value Value; 126 127 ConstMapIt() {} 128 129 ConstMapIt(Invalid i) : Parent(i) { } 130 131 explicit ConstMapIt(Map& _map) : map(_map) { 132 map.notifier()->first(*this); 133 } 134 135 ConstMapIt(const Map& _map, const Item& item) 136 : Parent(item), map(_map) {} 137 138 ConstMapIt& operator++() { 139 map.notifier()->next(*this); 140 return *this; 141 } 142 143 typename MapTraits<Map>::ConstReturnValue operator*() const { 144 return map[*this]; 145 } 146 147 protected: 148 const Map& map; 147 protected: 148 const Map* map; 149 149 }; 150 150 … … 153 153 154 154 public: 155 156 ItemIt() {} 157 158 ItemIt(Invalid i) : Parent(i) {}159 160 explicit ItemIt(Map& _map) : map( _map) {161 map .notifier()->first(*this);155 ItemIt() : map(NULL) {} 156 157 158 ItemIt(Invalid i) : Parent(i), map(NULL) {} 159 160 explicit ItemIt(Map& _map) : map(&_map) { 161 map->notifier()->first(*this); 162 162 } 163 163 164 164 ItemIt(const Map& _map, const Item& item) 165 : Parent(item), map( _map) {}165 : Parent(item), map(&_map) {} 166 166 167 167 ItemIt& operator++() { 168 map .notifier()->next(*this);169 return *this; 170 } 171 172 protected: 173 const Map ↦168 map->notifier()->next(*this); 169 return *this; 170 } 171 172 protected: 173 const Map* map; 174 174 175 175 }; … … 232 232 typedef typename Map::Value Value; 233 233 234 MapIt() {}235 236 MapIt(Invalid i) : Parent(i) { }237 238 explicit MapIt(Map& _map) : map( _map) {239 map .graph.first(*this);234 MapIt() : map(NULL) {} 235 236 MapIt(Invalid i) : Parent(i), map(NULL) { } 237 238 explicit MapIt(Map& _map) : map(&_map) { 239 map->graph.first(*this); 240 240 } 241 241 242 242 MapIt(const Map& _map, const Item& item) 243 : Parent(item), map( _map) {}243 : Parent(item), map(&_map) {} 244 244 245 245 MapIt& operator++() { 246 map .graph.next(*this);246 map->graph.next(*this); 247 247 return *this; 248 248 } 249 249 250 250 typename MapTraits<Map>::ConstReturnValue operator*() const { 251 return map[*this];251 return (*map)[*this]; 252 252 } 253 253 254 254 typename MapTraits<Map>::ReturnValue operator*() { 255 return map[*this];255 return (*map)[*this]; 256 256 } 257 257 258 258 void set(const Value& value) { 259 map .set(*this, value);260 } 261 262 protected: 263 Map ↦259 map->set(*this, value); 260 } 261 262 protected: 263 Map* map; 264 264 265 265 }; … … 272 272 typedef typename Map::Value Value; 273 273 274 ConstMapIt() {}275 276 ConstMapIt(Invalid i) : Parent(i) { }277 278 explicit ConstMapIt(Map& _map) : map( _map) {279 map .graph.first(*this);274 ConstMapIt() : map(NULL) {} 275 276 ConstMapIt(Invalid i) : Parent(i), map(NULL) { } 277 278 explicit ConstMapIt(Map& _map) : map(&_map) { 279 map->graph.first(*this); 280 280 } 281 281 282 282 ConstMapIt(const Map& _map, const Item& item) 283 : Parent(item), map( _map) {}283 : Parent(item), map(&_map) {} 284 284 285 285 ConstMapIt& operator++() { 286 map .graph.next(*this);286 map->graph.next(*this); 287 287 return *this; 288 288 } 289 289 290 290 typename MapTraits<Map>::ConstReturnValue operator*() const { 291 return map[*this];292 } 293 294 protected: 295 const Map ↦291 return (*map)[*this]; 292 } 293 294 protected: 295 const Map* map; 296 296 }; 297 297 … … 300 300 301 301 public: 302 303 ItemIt() {} 304 305 ItemIt(Invalid i) : Parent(i) { }306 307 explicit ItemIt(Map& _map) : map( _map) {308 map .graph.first(*this);302 ItemIt() : map(NULL) {} 303 304 305 ItemIt(Invalid i) : Parent(i), map(NULL) { } 306 307 explicit ItemIt(Map& _map) : map(&_map) { 308 map->graph.first(*this); 309 309 } 310 310 311 311 ItemIt(const Map& _map, const Item& item) 312 : Parent(item), map( _map) {}312 : Parent(item), map(&_map) {} 313 313 314 314 ItemIt& operator++() { 315 map .graph.next(*this);316 return *this; 317 } 318 319 protected: 320 const Map ↦315 map->graph.next(*this); 316 return *this; 317 } 318 319 protected: 320 const Map* map; 321 321 322 322 }; -
lemon/unionfind.h
r786 r800 740 740 void clear() { 741 741 items.clear(); 742 classes.clear ;742 classes.clear(); 743 743 firstClass = firstFreeClass = firstFreeItem = -1; 744 744 } -
test/CMakeLists.txt
r770 r799 35 35 min_mean_cycle_test 36 36 path_test 37 planarity_test 37 38 preflow_test 38 39 radix_sort_test -
test/Makefile.am
r793 r799 37 37 test/min_mean_cycle_test \ 38 38 test/path_test \ 39 test/planarity_test \ 39 40 test/preflow_test \ 40 41 test/radix_sort_test \ … … 86 87 test_min_mean_cycle_test_SOURCES = test/min_mean_cycle_test.cc 87 88 test_path_test_SOURCES = test/path_test.cc 89 test_planarity_test_SOURCES = test/planarity_test.cc 88 90 test_preflow_test_SOURCES = test/preflow_test.cc 89 91 test_radix_sort_test_SOURCES = test/radix_sort_test.cc
Note: See TracChangeset
for help on using the changeset viewer.