Changeset 913:2f9d9bcc1867 in lemon
- Timestamp:
- 02/26/10 17:08:30 (15 years ago)
- Branch:
- 1.1
- Parents:
- 908:c6f725eff737 (diff), 912:37f440367057 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Location:
- lemon
- Files:
-
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/Makefile.am
r868 r913 60 60 lemon/bfs.h \ 61 61 lemon/bin_heap.h \ 62 lemon/bucket_heap.h \63 62 lemon/cbc.h \ 64 63 lemon/circulation.h \ … … 78 77 lemon/error.h \ 79 78 lemon/euler.h \ 80 lemon/fib_heap.h \81 79 lemon/full_graph.h \ 82 80 lemon/glpk.h \ … … 101 99 lemon/path.h \ 102 100 lemon/preflow.h \ 103 lemon/radix_heap.h \104 101 lemon/radix_sort.h \ 105 102 lemon/random.h \ -
lemon/Makefile.am
r912 r913 91 91 lemon/lp_base.h \ 92 92 lemon/lp_skeleton.h \ 93 lemon/list_graph.h \94 93 lemon/maps.h \ 95 94 lemon/matching.h \ -
lemon/bits/map_extender.h
r867 r913 50 50 typedef typename Parent::ConstReference ConstReference; 51 51 52 typedef typename Parent::ReferenceMapTag ReferenceMapTag;53 54 52 class MapIt; 55 53 class ConstMapIt; … … 194 192 typedef typename Parent::ConstReference ConstReference; 195 193 196 typedef typename Parent::ReferenceMapTag ReferenceMapTag;197 198 194 class MapIt; 199 195 class ConstMapIt; -
lemon/bits/map_extender.h
r912 r913 83 83 typedef typename Map::Value Value; 84 84 85 MapIt() {}86 87 MapIt(Invalid i) : Parent(i) {}88 89 explicit MapIt(Map& _map) : map( _map) {90 map .notifier()->first(*this);85 MapIt() : map(NULL) {} 86 87 MapIt(Invalid i) : Parent(i), map(NULL) {} 88 89 explicit MapIt(Map& _map) : map(&_map) { 90 map->notifier()->first(*this); 91 91 } 92 92 93 93 MapIt(const Map& _map, const Item& item) 94 : Parent(item), map(&_map) {} 95 96 MapIt& operator++() { 97 map->notifier()->next(*this); 98 return *this; 99 } 100 101 typename MapTraits<Map>::ConstReturnValue operator*() const { 102 return (*map)[*this]; 103 } 104 105 typename MapTraits<Map>::ReturnValue operator*() { 106 return (*map)[*this]; 107 } 108 109 void set(const Value& value) { 110 map->set(*this, value); 111 } 112 113 protected: 114 Map* map; 115 116 }; 117 118 class ConstMapIt : public Item { 119 typedef Item Parent; 120 121 public: 122 123 typedef typename Map::Value Value; 124 125 ConstMapIt() : map(NULL) {} 126 127 ConstMapIt(Invalid i) : Parent(i), map(NULL) {} 128 129 explicit ConstMapIt(Map& _map) : map(&_map) { 130 map->notifier()->first(*this); 131 } 132 133 ConstMapIt(const Map& _map, const Item& item) 94 134 : Parent(item), map(_map) {} 95 135 96 MapIt& operator++() {97 map .notifier()->next(*this);136 ConstMapIt& operator++() { 137 map->notifier()->next(*this); 98 138 return *this; 99 139 } … … 103 143 } 104 144 105 typename MapTraits<Map>::ReturnValue operator*() { 106 return map[*this]; 107 } 108 109 void set(const Value& value) { 110 map.set(*this, value); 111 } 112 113 protected: 114 Map& map; 115 116 }; 117 118 class ConstMapIt : public Item { 119 typedef Item Parent; 120 121 public: 122 123 typedef typename Map::Value Value; 124 125 ConstMapIt() {} 126 127 ConstMapIt(Invalid i) : Parent(i) { } 128 129 explicit ConstMapIt(Map& _map) : map(_map) { 130 map.notifier()->first(*this); 131 } 132 133 ConstMapIt(const Map& _map, const Item& item) 134 : Parent(item), map(_map) {} 135 136 ConstMapIt& operator++() { 137 map.notifier()->next(*this); 138 return *this; 139 } 140 141 typename MapTraits<Map>::ConstReturnValue operator*() const { 142 return map[*this]; 143 } 144 145 protected: 146 const Map& map; 145 protected: 146 const Map* map; 147 147 }; 148 148 … … 151 151 152 152 public: 153 154 ItemIt() {} 155 156 ItemIt(Invalid i) : Parent(i) {}157 158 explicit ItemIt(Map& _map) : map( _map) {159 map .notifier()->first(*this);153 ItemIt() : map(NULL) {} 154 155 156 ItemIt(Invalid i) : Parent(i), map(NULL) {} 157 158 explicit ItemIt(Map& _map) : map(&_map) { 159 map->notifier()->first(*this); 160 160 } 161 161 162 162 ItemIt(const Map& _map, const Item& item) 163 : Parent(item), map( _map) {}163 : Parent(item), map(&_map) {} 164 164 165 165 ItemIt& operator++() { 166 map .notifier()->next(*this);167 return *this; 168 } 169 170 protected: 171 const Map ↦166 map->notifier()->next(*this); 167 return *this; 168 } 169 170 protected: 171 const Map* map; 172 172 173 173 }; … … 228 228 typedef typename Map::Value Value; 229 229 230 MapIt() {}231 232 MapIt(Invalid i) : Parent(i) { }233 234 explicit MapIt(Map& _map) : map( _map) {235 map .graph.first(*this);230 MapIt() : map(NULL) {} 231 232 MapIt(Invalid i) : Parent(i), map(NULL) { } 233 234 explicit MapIt(Map& _map) : map(&_map) { 235 map->graph.first(*this); 236 236 } 237 237 238 238 MapIt(const Map& _map, const Item& item) 239 : Parent(item), map( _map) {}239 : Parent(item), map(&_map) {} 240 240 241 241 MapIt& operator++() { 242 map .graph.next(*this);242 map->graph.next(*this); 243 243 return *this; 244 244 } 245 245 246 246 typename MapTraits<Map>::ConstReturnValue operator*() const { 247 return map[*this];247 return (*map)[*this]; 248 248 } 249 249 250 250 typename MapTraits<Map>::ReturnValue operator*() { 251 return map[*this];251 return (*map)[*this]; 252 252 } 253 253 254 254 void set(const Value& value) { 255 map .set(*this, value);256 } 257 258 protected: 259 Map ↦255 map->set(*this, value); 256 } 257 258 protected: 259 Map* map; 260 260 261 261 }; … … 268 268 typedef typename Map::Value Value; 269 269 270 ConstMapIt() {}271 272 ConstMapIt(Invalid i) : Parent(i) { }273 274 explicit ConstMapIt(Map& _map) : map( _map) {275 map .graph.first(*this);270 ConstMapIt() : map(NULL) {} 271 272 ConstMapIt(Invalid i) : Parent(i), map(NULL) { } 273 274 explicit ConstMapIt(Map& _map) : map(&_map) { 275 map->graph.first(*this); 276 276 } 277 277 278 278 ConstMapIt(const Map& _map, const Item& item) 279 : Parent(item), map( _map) {}279 : Parent(item), map(&_map) {} 280 280 281 281 ConstMapIt& operator++() { 282 map .graph.next(*this);282 map->graph.next(*this); 283 283 return *this; 284 284 } 285 285 286 286 typename MapTraits<Map>::ConstReturnValue operator*() const { 287 return map[*this];288 } 289 290 protected: 291 const Map ↦287 return (*map)[*this]; 288 } 289 290 protected: 291 const Map* map; 292 292 }; 293 293 … … 296 296 297 297 public: 298 299 ItemIt() {} 300 301 ItemIt(Invalid i) : Parent(i) { }302 303 explicit ItemIt(Map& _map) : map( _map) {304 map .graph.first(*this);298 ItemIt() : map(NULL) {} 299 300 301 ItemIt(Invalid i) : Parent(i), map(NULL) { } 302 303 explicit ItemIt(Map& _map) : map(&_map) { 304 map->graph.first(*this); 305 305 } 306 306 307 307 ItemIt(const Map& _map, const Item& item) 308 : Parent(item), map( _map) {}308 : Parent(item), map(&_map) {} 309 309 310 310 ItemIt& operator++() { 311 map .graph.next(*this);312 return *this; 313 } 314 315 protected: 316 const Map ↦311 map->graph.next(*this); 312 return *this; 313 } 314 315 protected: 316 const Map* map; 317 317 318 318 };
Note: See TracChangeset
for help on using the changeset viewer.