Changeset 1909:2d806130e700 in lemon-0.x for lemon/bits
- Timestamp:
- 01/26/06 16:42:13 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
- Location:
- lemon/bits
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/alteration_notifier.h
r1875 r1909 443 443 444 444 template <typename _Base> 445 class AlterableU ndirGraphExtender445 class AlterableUGraphExtender 446 446 : public AlterableGraphExtender<_Base> { 447 447 public: 448 448 449 typedef AlterableU ndirGraphExtender Graph;449 typedef AlterableUGraphExtender Graph; 450 450 typedef AlterableGraphExtender<_Base> Parent; 451 451 452 typedef typename Parent::U ndirEdge UndirEdge;452 typedef typename Parent::UEdge UEdge; 453 453 454 454 /// The edge observer registry. 455 typedef AlterationNotifier<U ndirEdge> UndirEdgeNotifier;456 457 protected: 458 459 mutable U ndirEdgeNotifier undir_edge_notifier;455 typedef AlterationNotifier<UEdge> UEdgeNotifier; 456 457 protected: 458 459 mutable UEdgeNotifier u_edge_notifier; 460 460 461 461 public: 462 462 463 463 using Parent::getNotifier; 464 U ndirEdgeNotifier& getNotifier(UndirEdge) const {465 return u ndir_edge_notifier;466 } 467 468 ~AlterableU ndirGraphExtender() {469 u ndir_edge_notifier.clear();464 UEdgeNotifier& getNotifier(UEdge) const { 465 return u_edge_notifier; 466 } 467 468 ~AlterableUGraphExtender() { 469 u_edge_notifier.clear(); 470 470 } 471 471 }; 472 472 473 473 template <typename _Base> 474 class AlterableU ndirEdgeSetExtender474 class AlterableUEdgeSetExtender 475 475 : public AlterableEdgeSetExtender<_Base> { 476 476 public: 477 477 478 typedef AlterableU ndirEdgeSetExtender Graph;478 typedef AlterableUEdgeSetExtender Graph; 479 479 typedef AlterableEdgeSetExtender<_Base> Parent; 480 480 481 typedef typename Parent::U ndirEdge UndirEdge;482 483 typedef AlterationNotifier<U ndirEdge> UndirEdgeNotifier;484 485 protected: 486 487 mutable U ndirEdgeNotifier undir_edge_notifier;481 typedef typename Parent::UEdge UEdge; 482 483 typedef AlterationNotifier<UEdge> UEdgeNotifier; 484 485 protected: 486 487 mutable UEdgeNotifier u_edge_notifier; 488 488 489 489 public: 490 490 491 491 using Parent::getNotifier; 492 U ndirEdgeNotifier& getNotifier(UndirEdge) const {493 return u ndir_edge_notifier;494 } 495 496 ~AlterableU ndirEdgeSetExtender() {497 u ndir_edge_notifier.clear();492 UEdgeNotifier& getNotifier(UEdge) const { 493 return u_edge_notifier; 494 } 495 496 ~AlterableUEdgeSetExtender() { 497 u_edge_notifier.clear(); 498 498 } 499 499 }; … … 502 502 503 503 template <typename _Base> 504 class AlterableU ndirBipartiteGraphExtender : public _Base {504 class AlterableUBipartiteGraphExtender : public _Base { 505 505 public: 506 506 507 507 typedef _Base Parent; 508 typedef AlterableU ndirBipartiteGraphExtender Graph;508 typedef AlterableUBipartiteGraphExtender Graph; 509 509 510 510 typedef typename Parent::Node Node; … … 512 512 typedef typename Parent::UpperNode UpperNode; 513 513 typedef typename Parent::Edge Edge; 514 typedef typename Parent::U ndirEdge UndirEdge;514 typedef typename Parent::UEdge UEdge; 515 515 516 516 … … 519 519 typedef AlterationNotifier<UpperNode> UpperNodeNotifier; 520 520 typedef AlterationNotifier<Edge> EdgeNotifier; 521 typedef AlterationNotifier<U ndirEdge> UndirEdgeNotifier;521 typedef AlterationNotifier<UEdge> UEdgeNotifier; 522 522 523 523 protected: … … 527 527 mutable UpperNodeNotifier upperNodeNotifier; 528 528 mutable EdgeNotifier edgeNotifier; 529 mutable U ndirEdgeNotifier undirEdgeNotifier;529 mutable UEdgeNotifier uEdgeNotifier; 530 530 531 531 public: … … 547 547 } 548 548 549 U ndirEdgeNotifier& getNotifier(UndirEdge) const {550 return u ndirEdgeNotifier;551 } 552 553 ~AlterableU ndirBipartiteGraphExtender() {549 UEdgeNotifier& getNotifier(UEdge) const { 550 return uEdgeNotifier; 551 } 552 553 ~AlterableUBipartiteGraphExtender() { 554 554 nodeNotifier.clear(); 555 555 lowerNodeNotifier.clear(); 556 556 upperNodeNotifier.clear(); 557 557 edgeNotifier.clear(); 558 u ndirEdgeNotifier.clear();558 uEdgeNotifier.clear(); 559 559 } 560 560 -
lemon/bits/clearable_graph_extender.h
r1842 r1909 43 43 44 44 template <typename _Base> 45 class ClearableU ndirGraphExtender : public _Base {45 class ClearableUGraphExtender : public _Base { 46 46 public: 47 47 48 typedef ClearableU ndirGraphExtender Graph;48 typedef ClearableUGraphExtender Graph; 49 49 typedef _Base Parent; 50 50 typedef typename Parent::Node Node; 51 typedef typename Parent::U ndirEdge UndirEdge;51 typedef typename Parent::UEdge UEdge; 52 52 typedef typename Parent::Edge Edge; 53 53 54 54 void clear() { 55 55 Parent::getNotifier(Node()).clear(); 56 Parent::getNotifier(U ndirEdge()).clear();56 Parent::getNotifier(UEdge()).clear(); 57 57 Parent::getNotifier(Edge()).clear(); 58 58 Parent::clear(); … … 61 61 62 62 template <typename _Base> 63 class ClearableU ndirEdgeSetExtender : public _Base {63 class ClearableUEdgeSetExtender : public _Base { 64 64 public: 65 65 66 typedef ClearableU ndirEdgeSetExtender Graph;66 typedef ClearableUEdgeSetExtender Graph; 67 67 typedef _Base Parent; 68 68 typedef typename Parent::Node Node; 69 typedef typename Parent::U ndirEdge UndirEdge;69 typedef typename Parent::UEdge UEdge; 70 70 typedef typename Parent::Edge Edge; 71 71 72 72 void clear() { 73 Parent::getNotifier(U ndirEdge()).clear();73 Parent::getNotifier(UEdge()).clear(); 74 74 Parent::getNotifier(Edge()).clear(); 75 75 Parent::clear(); … … 80 80 81 81 template <typename _Base> 82 class ClearableU ndirBipartiteGraphExtender : public _Base {82 class ClearableUBipartiteGraphExtender : public _Base { 83 83 public: 84 84 85 85 typedef _Base Parent; 86 typedef ClearableU ndirBipartiteGraphExtender Graph;86 typedef ClearableUBipartiteGraphExtender Graph; 87 87 88 88 typedef typename Parent::Node Node; … … 90 90 typedef typename Parent::UpperNode UpperNode; 91 91 typedef typename Parent::Edge Edge; 92 typedef typename Parent::U ndirEdge UndirEdge;92 typedef typename Parent::UEdge UEdge; 93 93 94 94 void clear() { 95 95 Parent::getNotifier(Edge()).clear(); 96 Parent::getNotifier(U ndirEdge()).clear();96 Parent::getNotifier(UEdge()).clear(); 97 97 Parent::getNotifier(Node()).clear(); 98 98 Parent::getNotifier(LowerNode()).clear(); -
lemon/bits/default_map.h
r1875 r1909 267 267 /// \e 268 268 template <typename _Base> 269 class MappableU ndirGraphExtender :269 class MappableUGraphExtender : 270 270 public MappableGraphExtender<_Base> { 271 271 public: 272 272 273 typedef MappableU ndirGraphExtender Graph;273 typedef MappableUGraphExtender Graph; 274 274 typedef MappableGraphExtender<_Base> Parent; 275 275 276 typedef typename Parent::U ndirEdge UndirEdge;277 278 template <typename _Value> 279 class U ndirEdgeMap280 : public IterableMapExtender<DefaultMap<Graph, U ndirEdge, _Value> > {281 public: 282 typedef MappableU ndirGraphExtender Graph;276 typedef typename Parent::UEdge UEdge; 277 278 template <typename _Value> 279 class UEdgeMap 280 : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > { 281 public: 282 typedef MappableUGraphExtender Graph; 283 283 typedef IterableMapExtender< 284 DefaultMap<Graph, U ndirEdge, _Value> > Parent;285 286 U ndirEdgeMap(const Graph& _g)287 : Parent(_g) {} 288 U ndirEdgeMap(const Graph& _g, const _Value& _v)289 : Parent(_g, _v) {} 290 291 U ndirEdgeMap& operator=(const UndirEdgeMap& cmap) {292 return operator=<U ndirEdgeMap>(cmap);293 } 294 295 template <typename CMap> 296 U ndirEdgeMap& operator=(const CMap& cmap) {297 checkConcept<concept::ReadMap<U ndirEdge, _Value>, CMap>();298 const typename Parent::Graph* graph = Parent::getGraph(); 299 U ndirEdge it;284 DefaultMap<Graph, UEdge, _Value> > Parent; 285 286 UEdgeMap(const Graph& _g) 287 : Parent(_g) {} 288 UEdgeMap(const Graph& _g, const _Value& _v) 289 : Parent(_g, _v) {} 290 291 UEdgeMap& operator=(const UEdgeMap& cmap) { 292 return operator=<UEdgeMap>(cmap); 293 } 294 295 template <typename CMap> 296 UEdgeMap& operator=(const CMap& cmap) { 297 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 298 const typename Parent::Graph* graph = Parent::getGraph(); 299 UEdge it; 300 300 for (graph->first(it); it != INVALID; graph->next(it)) { 301 301 Parent::set(it, cmap[it]); … … 310 310 /// \e 311 311 template <typename _Base> 312 class MappableU ndirEdgeSetExtender :312 class MappableUEdgeSetExtender : 313 313 public MappableEdgeSetExtender<_Base> { 314 314 public: 315 315 316 typedef MappableU ndirEdgeSetExtender Graph;316 typedef MappableUEdgeSetExtender Graph; 317 317 typedef MappableEdgeSetExtender<_Base> Parent; 318 318 319 typedef typename Parent::U ndirEdge UndirEdge;320 321 template <typename _Value> 322 class U ndirEdgeMap323 : public IterableMapExtender<DefaultMap<Graph, U ndirEdge, _Value> > {324 public: 325 typedef MappableU ndirEdgeSetExtender Graph;319 typedef typename Parent::UEdge UEdge; 320 321 template <typename _Value> 322 class UEdgeMap 323 : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > { 324 public: 325 typedef MappableUEdgeSetExtender Graph; 326 326 typedef IterableMapExtender< 327 DefaultMap<Graph, U ndirEdge, _Value> > Parent;328 329 U ndirEdgeMap(const Graph& _g)330 : Parent(_g) {} 331 U ndirEdgeMap(const Graph& _g, const _Value& _v)332 : Parent(_g, _v) {} 333 334 U ndirEdgeMap& operator=(const UndirEdgeMap& cmap) {335 return operator=<U ndirEdgeMap>(cmap);336 } 337 338 template <typename CMap> 339 U ndirEdgeMap& operator=(const CMap& cmap) {340 checkConcept<concept::ReadMap<U ndirEdge, _Value>, CMap>();341 const typename Parent::Graph* graph = Parent::getGraph(); 342 U ndirEdge it;327 DefaultMap<Graph, UEdge, _Value> > Parent; 328 329 UEdgeMap(const Graph& _g) 330 : Parent(_g) {} 331 UEdgeMap(const Graph& _g, const _Value& _v) 332 : Parent(_g, _v) {} 333 334 UEdgeMap& operator=(const UEdgeMap& cmap) { 335 return operator=<UEdgeMap>(cmap); 336 } 337 338 template <typename CMap> 339 UEdgeMap& operator=(const CMap& cmap) { 340 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 341 const typename Parent::Graph* graph = Parent::getGraph(); 342 UEdge it; 343 343 for (graph->first(it); it != INVALID; graph->next(it)) { 344 344 Parent::set(it, cmap[it]); … … 353 353 354 354 template <typename _Base> 355 class MappableU ndirBipartiteGraphExtender : public _Base {355 class MappableUBipartiteGraphExtender : public _Base { 356 356 public: 357 357 358 358 typedef _Base Parent; 359 typedef MappableU ndirBipartiteGraphExtender Graph;359 typedef MappableUBipartiteGraphExtender Graph; 360 360 361 361 typedef typename Parent::Node Node; … … 363 363 typedef typename Parent::LowerNode LowerNode; 364 364 typedef typename Parent::Edge Edge; 365 typedef typename Parent::U ndirEdge UndirEdge;365 typedef typename Parent::UEdge UEdge; 366 366 367 367 template <typename _Value> … … 369 369 : public IterableMapExtender<DefaultMap<Graph, UpperNode, _Value> > { 370 370 public: 371 typedef MappableU ndirBipartiteGraphExtender Graph;371 typedef MappableUBipartiteGraphExtender Graph; 372 372 typedef IterableMapExtender<DefaultMap<Graph, UpperNode, _Value> > 373 373 Parent; … … 406 406 : public IterableMapExtender<DefaultMap<Graph, LowerNode, _Value> > { 407 407 public: 408 typedef MappableU ndirBipartiteGraphExtender Graph;408 typedef MappableUBipartiteGraphExtender Graph; 409 409 typedef IterableMapExtender<DefaultMap<Graph, LowerNode, _Value> > 410 410 Parent; … … 444 444 class NodeMapBase : public Parent::NodeNotifier::ObserverBase { 445 445 public: 446 typedef MappableU ndirBipartiteGraphExtender Graph;446 typedef MappableUBipartiteGraphExtender Graph; 447 447 448 448 typedef Node Key; … … 524 524 : public IterableMapExtender<NodeMapBase<_Value> > { 525 525 public: 526 typedef MappableU ndirBipartiteGraphExtender Graph;526 typedef MappableUBipartiteGraphExtender Graph; 527 527 typedef IterableMapExtender< NodeMapBase<_Value> > Parent; 528 528 … … 562 562 : public IterableMapExtender<DefaultMap<Graph, Edge, _Value> > { 563 563 public: 564 typedef MappableU ndirBipartiteGraphExtender Graph;564 typedef MappableUBipartiteGraphExtender Graph; 565 565 typedef IterableMapExtender<DefaultMap<Graph, Edge, _Value> > Parent; 566 566 … … 587 587 588 588 template <typename _Value> 589 class U ndirEdgeMap590 : public IterableMapExtender<DefaultMap<Graph, U ndirEdge, _Value> > {591 public: 592 typedef MappableU ndirBipartiteGraphExtender Graph;593 typedef IterableMapExtender<DefaultMap<Graph, U ndirEdge, _Value> >589 class UEdgeMap 590 : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > { 591 public: 592 typedef MappableUBipartiteGraphExtender Graph; 593 typedef IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > 594 594 Parent; 595 595 596 U ndirEdgeMap(const Graph& _g)597 : Parent(_g) {} 598 U ndirEdgeMap(const Graph& _g, const _Value& _v)599 : Parent(_g, _v) {} 600 601 U ndirEdgeMap& operator=(const UndirEdgeMap& cmap) {602 return operator=<U ndirEdgeMap>(cmap);603 } 604 605 template <typename CMap> 606 U ndirEdgeMap& operator=(const CMap& cmap) {607 checkConcept<concept::ReadMap<U ndirEdge, _Value>, CMap>();608 const typename Parent::Graph* graph = Parent::getGraph(); 609 U ndirEdge it;596 UEdgeMap(const Graph& _g) 597 : Parent(_g) {} 598 UEdgeMap(const Graph& _g, const _Value& _v) 599 : Parent(_g, _v) {} 600 601 UEdgeMap& operator=(const UEdgeMap& cmap) { 602 return operator=<UEdgeMap>(cmap); 603 } 604 605 template <typename CMap> 606 UEdgeMap& operator=(const CMap& cmap) { 607 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 608 const typename Parent::Graph* graph = Parent::getGraph(); 609 UEdge it; 610 610 for (graph->first(it); it != INVALID; graph->next(it)) { 611 611 Parent::set(it, cmap[it]); -
lemon/bits/erasable_graph_extender.h
r1842 r1909 63 63 64 64 template <typename _Base> 65 class ErasableU ndirGraphExtender : public _Base {65 class ErasableUGraphExtender : public _Base { 66 66 public: 67 67 68 typedef ErasableU ndirGraphExtender Graph;68 typedef ErasableUGraphExtender Graph; 69 69 typedef _Base Parent; 70 70 71 71 typedef typename Parent::Node Node; 72 typedef typename Parent::U ndirEdge UndirEdge;72 typedef typename Parent::UEdge UEdge; 73 73 typedef typename Parent::Edge Edge; 74 74 … … 85 85 } 86 86 87 void erase(const U ndirEdge& uedge) {87 void erase(const UEdge& uedge) { 88 88 std::vector<Edge> edges; 89 89 edges.push_back(Parent::direct(uedge,true)); 90 90 edges.push_back(Parent::direct(uedge,false)); 91 91 Parent::getNotifier(Edge()).erase(edges); 92 Parent::getNotifier(U ndirEdge()).erase(uedge);92 Parent::getNotifier(UEdge()).erase(uedge); 93 93 Parent::erase(uedge); 94 94 } … … 97 97 98 98 template <typename _Base> 99 class ErasableU ndirEdgeSetExtender : public _Base {99 class ErasableUEdgeSetExtender : public _Base { 100 100 public: 101 101 102 typedef ErasableU ndirEdgeSetExtender Graph;102 typedef ErasableUEdgeSetExtender Graph; 103 103 typedef _Base Parent; 104 104 105 105 typedef typename Parent::Node Node; 106 typedef typename Parent::U ndirEdge UndirEdge;106 typedef typename Parent::UEdge UEdge; 107 107 typedef typename Parent::Edge Edge; 108 108 109 void erase(const U ndirEdge& uedge) {109 void erase(const UEdge& uedge) { 110 110 std::vector<Edge> edges; 111 111 edges.push_back(Parent::direct(uedge,true)); 112 112 edges.push_back(Parent::direct(uedge,false)); 113 113 Parent::getNotifier(Edge()).erase(edges); 114 Parent::getNotifier(U ndirEdge()).erase(uedge);114 Parent::getNotifier(UEdge()).erase(uedge); 115 115 Parent::erase(uedge); 116 116 } -
lemon/bits/extendable_graph_extender.h
r1842 r1909 49 49 50 50 template <typename _Base> 51 class ExtendableU ndirGraphExtender : public _Base {51 class ExtendableUGraphExtender : public _Base { 52 52 public: 53 53 54 typedef ExtendableU ndirGraphExtender Graph;54 typedef ExtendableUGraphExtender Graph; 55 55 typedef _Base Parent; 56 56 57 57 typedef typename Parent::Node Node; 58 58 typedef typename Parent::Edge Edge; 59 typedef typename Parent::U ndirEdge UndirEdge;59 typedef typename Parent::UEdge UEdge; 60 60 61 61 Node addNode() { … … 65 65 } 66 66 67 U ndirEdge addEdge(const Node& from, const Node& to) {68 U ndirEdge uedge = Parent::addEdge(from, to);69 Parent::getNotifier(U ndirEdge()).add(uedge);67 UEdge addEdge(const Node& from, const Node& to) { 68 UEdge uedge = Parent::addEdge(from, to); 69 Parent::getNotifier(UEdge()).add(uedge); 70 70 71 71 std::vector<Edge> edges; … … 80 80 81 81 template <typename _Base> 82 class ExtendableU ndirEdgeSetExtender : public _Base {82 class ExtendableUEdgeSetExtender : public _Base { 83 83 public: 84 84 85 typedef ExtendableU ndirEdgeSetExtender Graph;85 typedef ExtendableUEdgeSetExtender Graph; 86 86 typedef _Base Parent; 87 87 88 88 typedef typename Parent::Node Node; 89 89 typedef typename Parent::Edge Edge; 90 typedef typename Parent::U ndirEdge UndirEdge;90 typedef typename Parent::UEdge UEdge; 91 91 92 U ndirEdge addEdge(const Node& from, const Node& to) {93 U ndirEdge uedge = Parent::addEdge(from, to);94 Parent::getNotifier(U ndirEdge()).add(uedge);92 UEdge addEdge(const Node& from, const Node& to) { 93 UEdge uedge = Parent::addEdge(from, to); 94 Parent::getNotifier(UEdge()).add(uedge); 95 95 96 96 std::vector<Edge> edges; … … 106 106 107 107 template <typename _Base> 108 class ExtendableU ndirBipartiteGraphExtender : public _Base {108 class ExtendableUBipartiteGraphExtender : public _Base { 109 109 public: 110 110 111 111 typedef _Base Parent; 112 typedef ExtendableU ndirBipartiteGraphExtender Graph;112 typedef ExtendableUBipartiteGraphExtender Graph; 113 113 114 114 typedef typename Parent::Node Node; … … 116 116 typedef typename Parent::UpperNode UpperNode; 117 117 typedef typename Parent::Edge Edge; 118 typedef typename Parent::U ndirEdge UndirEdge;118 typedef typename Parent::UEdge UEdge; 119 119 120 120 Node addUpperNode() { … … 132 132 } 133 133 134 U ndirEdge addEdge(const Node& source, const Node& target) {135 U ndirEdge undiredge = Parent::addEdge(source, target);136 Parent::getNotifier(U ndirEdge()).add(undiredge);134 UEdge addEdge(const Node& source, const Node& target) { 135 UEdge uedge = Parent::addEdge(source, target); 136 Parent::getNotifier(UEdge()).add(uedge); 137 137 138 138 std::vector<Edge> edges; 139 edges.push_back(Parent::direct(u ndiredge, true));140 edges.push_back(Parent::direct(u ndiredge, false));139 edges.push_back(Parent::direct(uedge, true)); 140 edges.push_back(Parent::direct(uedge, false)); 141 141 Parent::getNotifier(Edge()).add(edges); 142 142 143 return u ndiredge;143 return uedge; 144 144 } 145 145 -
lemon/bits/graph_extender.h
r1875 r1909 62 62 63 63 template <typename _Base> 64 class U ndirGraphExtender : public _Base {64 class UGraphExtender : public _Base { 65 65 typedef _Base Parent; 66 typedef U ndirGraphExtender Graph;66 typedef UGraphExtender Graph; 67 67 68 68 public: 69 69 70 typedef typename Parent::Edge U ndirEdge;70 typedef typename Parent::Edge UEdge; 71 71 typedef typename Parent::Node Node; 72 72 73 class Edge : public U ndirEdge {74 friend class U ndirGraphExtender;73 class Edge : public UEdge { 74 friend class UGraphExtender; 75 75 76 76 protected: … … 79 79 bool forward; 80 80 81 Edge(const U ndirEdge &ue, bool _forward) :82 U ndirEdge(ue), forward(_forward) {}81 Edge(const UEdge &ue, bool _forward) : 82 UEdge(ue), forward(_forward) {} 83 83 84 84 public: … … 86 86 87 87 /// Invalid edge constructor 88 Edge(Invalid i) : U ndirEdge(i), forward(true) {}88 Edge(Invalid i) : UEdge(i), forward(true) {} 89 89 90 90 bool operator==(const Edge &that) const { 91 return forward==that.forward && U ndirEdge(*this)==UndirEdge(that);91 return forward==that.forward && UEdge(*this)==UEdge(that); 92 92 } 93 93 bool operator!=(const Edge &that) const { 94 return forward!=that.forward || U ndirEdge(*this)!=UndirEdge(that);94 return forward!=that.forward || UEdge(*this)!=UEdge(that); 95 95 } 96 96 bool operator<(const Edge &that) const { 97 97 return forward<that.forward || 98 (!(that.forward<forward) && U ndirEdge(*this)<UndirEdge(that));98 (!(that.forward<forward) && UEdge(*this)<UEdge(that)); 99 99 } 100 100 }; … … 127 127 } 128 128 129 Node oppositeNode(const Node &n, const U ndirEdge &e) const {129 Node oppositeNode(const Node &n, const UEdge &e) const { 130 130 if( n == Parent::source(e)) 131 131 return Parent::target(e); … … 138 138 /// \brief Directed edge from an undirected edge and a source node. 139 139 /// 140 /// Returns a (directed) Edge corresponding to the specified U ndirEdge140 /// Returns a (directed) Edge corresponding to the specified UEdge 141 141 /// and source Node. 142 142 /// 143 Edge direct(const U ndirEdge &ue, const Node &s) const {143 Edge direct(const UEdge &ue, const Node &s) const { 144 144 return Edge(ue, s == source(ue)); 145 145 } … … 147 147 /// \brief Directed edge from an undirected edge. 148 148 /// 149 /// Returns a directed edge corresponding to the specified U ndirEdge.149 /// Returns a directed edge corresponding to the specified UEdge. 150 150 /// If the given bool is true the given undirected edge and the 151 151 /// returned edge have the same source node. 152 Edge direct(const U ndirEdge &ue, bool d) const {152 Edge direct(const UEdge &ue, bool d) const { 153 153 return Edge(ue, d); 154 154 } … … 183 183 void firstOut(Edge &e, const Node &n) const { 184 184 Parent::firstIn(e,n); 185 if( U ndirEdge(e) != INVALID ) {185 if( UEdge(e) != INVALID ) { 186 186 e.forward = false; 187 187 } … … 195 195 Node n = Parent::target(e); 196 196 Parent::nextIn(e); 197 if( U ndirEdge(e) == INVALID ) {197 if( UEdge(e) == INVALID ) { 198 198 Parent::firstOut(e, n); 199 199 e.forward = true; … … 207 207 void firstIn(Edge &e, const Node &n) const { 208 208 Parent::firstOut(e,n); 209 if( U ndirEdge(e) != INVALID ) {209 if( UEdge(e) != INVALID ) { 210 210 e.forward = false; 211 211 } … … 219 219 Node n = Parent::source(e); 220 220 Parent::nextOut(e); 221 if( U ndirEdge(e) == INVALID ) {221 if( UEdge(e) == INVALID ) { 222 222 Parent::firstIn(e, n); 223 223 e.forward = true; … … 229 229 } 230 230 231 void firstInc(U ndirEdge &e, const Node &n) const {231 void firstInc(UEdge &e, const Node &n) const { 232 232 Parent::firstOut(e, n); 233 233 if (e != INVALID) return; 234 234 Parent::firstIn(e, n); 235 235 } 236 void nextInc(U ndirEdge &e, const Node &n) const {236 void nextInc(UEdge &e, const Node &n) const { 237 237 if (Parent::source(e) == n) { 238 238 Parent::nextOut(e); … … 244 244 } 245 245 246 void firstInc(U ndirEdge &e, bool &d, const Node &n) const {246 void firstInc(UEdge &e, bool &d, const Node &n) const { 247 247 d = true; 248 248 Parent::firstOut(e, n); … … 251 251 Parent::firstIn(e, n); 252 252 } 253 void nextInc(U ndirEdge &e, bool &d) const {253 void nextInc(UEdge &e, bool &d) const { 254 254 if (d) { 255 255 Node s = Parent::source(e); … … 276 276 } 277 277 278 int id(const U ndirEdge &e) const {278 int id(const UEdge &e) const { 279 279 return Parent::id(e); 280 280 } … … 292 292 } 293 293 294 int maxU ndirEdgeId() const {294 int maxUEdgeId() const { 295 295 return Parent::maxEdgeId(); 296 296 } … … 303 303 return maxEdgeId(); 304 304 } 305 int maxId(U ndirEdge) const {306 return maxU ndirEdgeId();305 int maxId(UEdge) const { 306 return maxUEdgeId(); 307 307 } 308 308 … … 311 311 } 312 312 313 int u ndirEdgeNum() const {313 int uEdgeNum() const { 314 314 return Parent::edgeNum(); 315 315 } … … 323 323 } 324 324 325 U ndirEdge undirEdgeFromId(int id) const {325 UEdge uEdgeFromId(int id) const { 326 326 return Parent::edgeFromId(id >> 1); 327 327 } … … 335 335 } 336 336 337 U ndirEdge fromId(int id, UndirEdge) const {338 return u ndirEdgeFromId(id);337 UEdge fromId(int id, UEdge) const { 338 return uEdgeFromId(id); 339 339 } 340 340 … … 342 342 Edge findEdge(Node source, Node target, Edge prev) const { 343 343 if (prev == INVALID) { 344 U ndirEdge edge = Parent::findEdge(source, target);344 UEdge edge = Parent::findEdge(source, target); 345 345 if (edge != INVALID) return direct(edge, true); 346 346 edge = Parent::findEdge(target, source); 347 347 if (edge != INVALID) return direct(edge, false); 348 348 } else if (direction(prev)) { 349 U ndirEdge edge = Parent::findEdge(source, target, prev);349 UEdge edge = Parent::findEdge(source, target, prev); 350 350 if (edge != INVALID) return direct(edge, true); 351 351 edge = Parent::findEdge(target, source); 352 352 if (edge != INVALID) return direct(edge, false); 353 353 } else { 354 U ndirEdge edge = Parent::findEdge(target, source, prev);354 UEdge edge = Parent::findEdge(target, source, prev); 355 355 if (edge != INVALID) return direct(edge, false); 356 356 } … … 358 358 } 359 359 360 U ndirEdge findUndirEdge(Node source, Node target, UndirEdge prev) const {360 UEdge findUEdge(Node source, Node target, UEdge prev) const { 361 361 if (prev == INVALID) { 362 U ndirEdge edge = Parent::findEdge(source, target);362 UEdge edge = Parent::findEdge(source, target); 363 363 if (edge != INVALID) return edge; 364 364 edge = Parent::findEdge(target, source); 365 365 if (edge != INVALID) return edge; 366 366 } else if (Parent::source(prev) == source) { 367 U ndirEdge edge = Parent::findEdge(source, target, prev);367 UEdge edge = Parent::findEdge(source, target, prev); 368 368 if (edge != INVALID) return edge; 369 369 edge = Parent::findEdge(target, source); 370 370 if (edge != INVALID) return edge; 371 371 } else { 372 U ndirEdge edge = Parent::findEdge(target, source, prev);372 UEdge edge = Parent::findEdge(target, source, prev); 373 373 if (edge != INVALID) return edge; 374 374 } … … 380 380 381 381 template <typename _Base> 382 class U ndirBipartiteGraphExtender : public _Base {382 class UBipartiteGraphExtender : public _Base { 383 383 public: 384 384 typedef _Base Parent; 385 typedef U ndirBipartiteGraphExtender Graph;385 typedef UBipartiteGraphExtender Graph; 386 386 387 387 typedef typename Parent::Node Node; 388 typedef typename Parent::Edge U ndirEdge;388 typedef typename Parent::Edge UEdge; 389 389 390 390 using Parent::first; … … 393 393 using Parent::id; 394 394 395 Node source(const U ndirEdge& edge) const {395 Node source(const UEdge& edge) const { 396 396 return upperNode(edge); 397 397 } 398 Node target(const U ndirEdge& edge) const {398 Node target(const UEdge& edge) const { 399 399 return lowerNode(edge); 400 400 } 401 401 402 void firstInc(U ndirEdge& edge, bool& direction, const Node& node) const {402 void firstInc(UEdge& edge, bool& direction, const Node& node) const { 403 403 if (Parent::upper(node)) { 404 404 Parent::firstDown(edge, node); … … 406 406 } else { 407 407 Parent::firstUp(edge, node); 408 direction = static_cast<U ndirEdge&>(edge) == INVALID;409 } 410 } 411 void nextInc(U ndirEdge& edge, bool& direction) const {408 direction = static_cast<UEdge&>(edge) == INVALID; 409 } 410 } 411 void nextInc(UEdge& edge, bool& direction) const { 412 412 if (direction) { 413 413 Parent::nextDown(edge); … … 418 418 } 419 419 420 int maxU ndirEdgeId() const {420 int maxUEdgeId() const { 421 421 return Parent::maxEdgeId(); 422 422 } 423 423 424 U ndirEdge undirEdgeFromId(int id) const {424 UEdge uEdgeFromId(int id) const { 425 425 return Parent::edgeFromId(id); 426 426 } 427 427 428 class Edge : public U ndirEdge {429 friend class U ndirBipartiteGraphExtender;428 class Edge : public UEdge { 429 friend class UBipartiteGraphExtender; 430 430 protected: 431 431 bool forward; 432 432 433 Edge(const U ndirEdge& edge, bool _forward)434 : U ndirEdge(edge), forward(_forward) {}433 Edge(const UEdge& edge, bool _forward) 434 : UEdge(edge), forward(_forward) {} 435 435 436 436 public: 437 437 Edge() {} 438 Edge (Invalid) : U ndirEdge(INVALID), forward(true) {}438 Edge (Invalid) : UEdge(INVALID), forward(true) {} 439 439 bool operator==(const Edge& i) const { 440 return U ndirEdge::operator==(i) && forward == i.forward;440 return UEdge::operator==(i) && forward == i.forward; 441 441 } 442 442 bool operator!=(const Edge& i) const { 443 return U ndirEdge::operator!=(i) || forward != i.forward;443 return UEdge::operator!=(i) || forward != i.forward; 444 444 } 445 445 bool operator<(const Edge& i) const { 446 return U ndirEdge::operator<(i) ||447 (!(i.forward<forward) && U ndirEdge(*this)<UndirEdge(i));446 return UEdge::operator<(i) || 447 (!(i.forward<forward) && UEdge(*this)<UEdge(i)); 448 448 } 449 449 }; 450 450 451 451 void first(Edge& edge) const { 452 Parent::first(static_cast<U ndirEdge&>(edge));452 Parent::first(static_cast<UEdge&>(edge)); 453 453 edge.forward = true; 454 454 } … … 456 456 void next(Edge& edge) const { 457 457 if (!edge.forward) { 458 Parent::next(static_cast<U ndirEdge&>(edge));458 Parent::next(static_cast<UEdge&>(edge)); 459 459 } 460 460 edge.forward = !edge.forward; … … 467 467 } else { 468 468 Parent::firstUp(edge, node); 469 edge.forward = static_cast<U ndirEdge&>(edge) == INVALID;469 edge.forward = static_cast<UEdge&>(edge) == INVALID; 470 470 } 471 471 } … … 475 475 } else { 476 476 Parent::nextUp(edge); 477 edge.forward = static_cast<U ndirEdge&>(edge) == INVALID;477 edge.forward = static_cast<UEdge&>(edge) == INVALID; 478 478 } 479 479 } … … 485 485 } else { 486 486 Parent::firstDown(edge, node); 487 edge.forward = static_cast<U ndirEdge&>(edge) == INVALID;487 edge.forward = static_cast<UEdge&>(edge) == INVALID; 488 488 } 489 489 } … … 493 493 } else { 494 494 Parent::nextDown(edge); 495 edge.forward = static_cast<U ndirEdge&>(edge) == INVALID;495 edge.forward = static_cast<UEdge&>(edge) == INVALID; 496 496 } 497 497 } … … 508 508 } 509 509 510 Edge direct(const U ndirEdge& edge, const Node& node) const {510 Edge direct(const UEdge& edge, const Node& node) const { 511 511 return Edge(edge, node == Parent::source(edge)); 512 512 } 513 513 514 Edge direct(const U ndirEdge& edge, bool direction) const {514 Edge direct(const UEdge& edge, bool direction) const { 515 515 return Edge(edge, direction); 516 516 } 517 517 518 Node oppositeNode(const U ndirEdge& edge, const Node& node) const {518 Node oppositeNode(const UEdge& edge, const Node& node) const { 519 519 return source(edge) == node ? 520 520 target(edge) : source(edge); … … 529 529 } 530 530 Edge edgeFromId(int id) const { 531 return Edge(Parent::fromId(id >> 1, U ndirEdge()), (id & 1) == 0);531 return Edge(Parent::fromId(id >> 1, UEdge()), (id & 1) == 0); 532 532 } 533 533 int maxEdgeId() const { 534 return (Parent::maxId(U ndirEdge()) << 1) + 1;534 return (Parent::maxId(UEdge()) << 1) + 1; 535 535 } 536 536 537 537 class UpperNode : public Node { 538 friend class U ndirBipartiteGraphExtender;538 friend class UBipartiteGraphExtender; 539 539 public: 540 540 UpperNode() {} … … 558 558 559 559 class LowerNode : public Node { 560 friend class U ndirBipartiteGraphExtender;560 friend class UBipartiteGraphExtender; 561 561 public: 562 562 LowerNode() {} … … 593 593 return maxEdgeId(); 594 594 } 595 int maxId(U ndirEdge) const {596 return maxU ndirEdgeId();595 int maxId(UEdge) const { 596 return maxUEdgeId(); 597 597 } 598 598 … … 610 610 return edgeFromId(id); 611 611 } 612 U ndirEdge fromId(int id, UndirEdge) const {613 return u ndirEdgeFromId(id);612 UEdge fromId(int id, UEdge) const { 613 return uEdgeFromId(id); 614 614 } 615 615 -
lemon/bits/iterable_graph_extender.h
r1820 r1909 17 17 /// 18 18 ///\bug Should it be here? 19 typedef False U ndirTag;19 typedef False UTag; 20 20 21 21 typedef _Base Parent; … … 175 175 176 176 template <typename _Base> 177 class IterableU ndirGraphExtender : public IterableGraphExtender<_Base> {177 class IterableUGraphExtender : public IterableGraphExtender<_Base> { 178 178 public: 179 179 … … 185 185 ///\bug Should be tested in the concept checker whether it is defined 186 186 ///correctly. 187 typedef True U ndirTag;187 typedef True UTag; 188 188 189 189 typedef IterableGraphExtender<_Base> Parent; 190 typedef IterableU ndirGraphExtender<_Base> Graph;190 typedef IterableUGraphExtender<_Base> Graph; 191 191 typedef typename Parent::Node Node; 192 192 typedef typename Parent::Edge Edge; 193 typedef typename Parent::U ndirEdge UndirEdge;194 195 class U ndirEdgeIt : public Parent::UndirEdge {196 const Graph* graph; 197 public: 198 199 U ndirEdgeIt() { }200 201 U ndirEdgeIt(Invalid i) : UndirEdge(i) { }202 203 explicit U ndirEdgeIt(const Graph& _graph) : graph(&_graph) {204 _graph.first(*static_cast<U ndirEdge*>(this));205 } 206 207 U ndirEdgeIt(const Graph& _graph, const UndirEdge& e) :208 U ndirEdge(e), graph(&_graph) { }209 210 U ndirEdgeIt& operator++() {193 typedef typename Parent::UEdge UEdge; 194 195 class UEdgeIt : public Parent::UEdge { 196 const Graph* graph; 197 public: 198 199 UEdgeIt() { } 200 201 UEdgeIt(Invalid i) : UEdge(i) { } 202 203 explicit UEdgeIt(const Graph& _graph) : graph(&_graph) { 204 _graph.first(*static_cast<UEdge*>(this)); 205 } 206 207 UEdgeIt(const Graph& _graph, const UEdge& e) : 208 UEdge(e), graph(&_graph) { } 209 210 UEdgeIt& operator++() { 211 211 graph->next(*this); 212 212 return *this; … … 215 215 }; 216 216 217 class IncEdgeIt : public Parent::U ndirEdge {217 class IncEdgeIt : public Parent::UEdge { 218 218 const Graph* graph; 219 219 bool direction; 220 friend class IterableU ndirGraphExtender;220 friend class IterableUGraphExtender; 221 221 public: 222 222 223 223 IncEdgeIt() { } 224 224 225 IncEdgeIt(Invalid i) : U ndirEdge(i), direction(false) { }225 IncEdgeIt(Invalid i) : UEdge(i), direction(false) { } 226 226 227 227 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { … … 229 229 } 230 230 231 IncEdgeIt(const Graph& _graph, const U ndirEdge &ue, const Node &n)232 : graph(&_graph), U ndirEdge(ue) {231 IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n) 232 : graph(&_graph), UEdge(ue) { 233 233 direction = (_graph.source(ue) == n); 234 234 } … … 259 259 /// 260 260 /// Gives back the opposite on the given undirected edge. 261 Node oppositeNode(const Node& n, const U ndirEdge& e) const {261 Node oppositeNode(const Node& n, const UEdge& e) const { 262 262 if (Parent::source(e) == n) { 263 263 return Parent::target(e); … … 271 271 272 272 template <typename _Base> 273 class IterableU ndirBipartiteGraphExtender : public _Base {273 class IterableUBipartiteGraphExtender : public _Base { 274 274 public: 275 275 typedef _Base Parent; 276 typedef IterableU ndirBipartiteGraphExtender Graph;276 typedef IterableUBipartiteGraphExtender Graph; 277 277 278 278 typedef typename Parent::Node Node; … … 280 280 typedef typename Parent::LowerNode LowerNode; 281 281 typedef typename Parent::Edge Edge; 282 typedef typename Parent::U ndirEdge UndirEdge;282 typedef typename Parent::UEdge UEdge; 283 283 284 284 class NodeIt : public Node { … … 305 305 306 306 class UpperNodeIt : public Node { 307 friend class IterableU ndirBipartiteGraphExtender;307 friend class IterableUBipartiteGraphExtender; 308 308 const Graph* graph; 309 309 public: … … 327 327 328 328 class LowerNodeIt : public Node { 329 friend class IterableU ndirBipartiteGraphExtender;329 friend class IterableUBipartiteGraphExtender; 330 330 const Graph* graph; 331 331 public: … … 349 349 350 350 class EdgeIt : public Edge { 351 friend class IterableU ndirBipartiteGraphExtender;351 friend class IterableUBipartiteGraphExtender; 352 352 const Graph* graph; 353 353 public: … … 371 371 }; 372 372 373 class U ndirEdgeIt : public UndirEdge {374 friend class IterableU ndirBipartiteGraphExtender;375 const Graph* graph; 376 public: 377 378 U ndirEdgeIt() { }379 380 U ndirEdgeIt(Invalid i) : UndirEdge(INVALID) { }381 382 explicit U ndirEdgeIt(const Graph& _graph) : graph(&_graph) {383 graph->first(static_cast<U ndirEdge&>(*this));384 } 385 386 U ndirEdgeIt(const Graph& _graph, const UndirEdge& edge)387 : U ndirEdge(edge), graph(&_graph) { }388 389 U ndirEdgeIt& operator++() {373 class UEdgeIt : public UEdge { 374 friend class IterableUBipartiteGraphExtender; 375 const Graph* graph; 376 public: 377 378 UEdgeIt() { } 379 380 UEdgeIt(Invalid i) : UEdge(INVALID) { } 381 382 explicit UEdgeIt(const Graph& _graph) : graph(&_graph) { 383 graph->first(static_cast<UEdge&>(*this)); 384 } 385 386 UEdgeIt(const Graph& _graph, const UEdge& edge) 387 : UEdge(edge), graph(&_graph) { } 388 389 UEdgeIt& operator++() { 390 390 graph->next(*this); 391 391 return *this; … … 394 394 395 395 class OutEdgeIt : public Edge { 396 friend class IterableU ndirBipartiteGraphExtender;396 friend class IterableUBipartiteGraphExtender; 397 397 const Graph* graph; 398 398 public: … … 419 419 420 420 class InEdgeIt : public Edge { 421 friend class IterableU ndirBipartiteGraphExtender;421 friend class IterableUBipartiteGraphExtender; 422 422 const Graph* graph; 423 423 public: … … 470 470 } 471 471 472 class IncEdgeIt : public Parent::U ndirEdge {473 friend class IterableU ndirBipartiteGraphExtender;472 class IncEdgeIt : public Parent::UEdge { 473 friend class IterableUBipartiteGraphExtender; 474 474 const Graph* graph; 475 475 bool direction; … … 478 478 IncEdgeIt() { } 479 479 480 IncEdgeIt(Invalid i) : U ndirEdge(i), direction(true) { }480 IncEdgeIt(Invalid i) : UEdge(i), direction(true) { } 481 481 482 482 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { … … 484 484 } 485 485 486 IncEdgeIt(const Graph& _graph, const U ndirEdge &ue, const Node &n)487 : graph(&_graph), U ndirEdge(ue) {486 IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n) 487 : graph(&_graph), UEdge(ue) { 488 488 direction = (graph->source(ue) == n); 489 489 } -
lemon/bits/static_map.h
r1875 r1909 306 306 /// \e 307 307 template <typename _Base> 308 class StaticMappableU ndirGraphExtender :308 class StaticMappableUGraphExtender : 309 309 public StaticMappableGraphExtender<_Base> { 310 310 public: 311 311 312 typedef StaticMappableU ndirGraphExtender Graph;312 typedef StaticMappableUGraphExtender Graph; 313 313 typedef StaticMappableGraphExtender<_Base> Parent; 314 314 315 typedef typename Parent::U ndirEdge UndirEdge;316 317 template <typename _Value> 318 class U ndirEdgeMap319 : public IterableMapExtender<StaticMap<Graph, U ndirEdge, _Value> > {320 public: 321 typedef StaticMappableU ndirGraphExtender Graph;315 typedef typename Parent::UEdge UEdge; 316 317 template <typename _Value> 318 class UEdgeMap 319 : public IterableMapExtender<StaticMap<Graph, UEdge, _Value> > { 320 public: 321 typedef StaticMappableUGraphExtender Graph; 322 322 typedef IterableMapExtender< 323 StaticMap<Graph, U ndirEdge, _Value> > Parent;324 325 U ndirEdgeMap(const Graph& _g)326 : Parent(_g) {} 327 U ndirEdgeMap(const Graph& _g, const _Value& _v)328 : Parent(_g, _v) {} 329 330 U ndirEdgeMap& operator=(const UndirEdgeMap& cmap) {331 return operator=<U ndirEdgeMap>(cmap);332 } 333 334 template <typename CMap> 335 U ndirEdgeMap& operator=(const CMap& cmap) {336 checkConcept<concept::ReadMap<U ndirEdge, _Value>, CMap>();337 const typename Parent::Graph* graph = Parent::getGraph(); 338 U ndirEdge it;323 StaticMap<Graph, UEdge, _Value> > Parent; 324 325 UEdgeMap(const Graph& _g) 326 : Parent(_g) {} 327 UEdgeMap(const Graph& _g, const _Value& _v) 328 : Parent(_g, _v) {} 329 330 UEdgeMap& operator=(const UEdgeMap& cmap) { 331 return operator=<UEdgeMap>(cmap); 332 } 333 334 template <typename CMap> 335 UEdgeMap& operator=(const CMap& cmap) { 336 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 337 const typename Parent::Graph* graph = Parent::getGraph(); 338 UEdge it; 339 339 for (graph->first(it); it != INVALID; graph->next(it)) { 340 340 Parent::set(it, cmap[it]); … … 347 347 348 348 template <typename _Base> 349 class StaticMappableU ndirBipartiteGraphExtender : public _Base {349 class StaticMappableUBipartiteGraphExtender : public _Base { 350 350 public: 351 351 352 352 typedef _Base Parent; 353 typedef StaticMappableU ndirBipartiteGraphExtender Graph;353 typedef StaticMappableUBipartiteGraphExtender Graph; 354 354 355 355 typedef typename Parent::Node Node; … … 357 357 typedef typename Parent::LowerNode LowerNode; 358 358 typedef typename Parent::Edge Edge; 359 typedef typename Parent::U ndirEdge UndirEdge;359 typedef typename Parent::UEdge UEdge; 360 360 361 361 template <typename _Value> … … 363 363 : public IterableMapExtender<StaticMap<Graph, UpperNode, _Value> > { 364 364 public: 365 typedef StaticMappableU ndirBipartiteGraphExtender Graph;365 typedef StaticMappableUBipartiteGraphExtender Graph; 366 366 typedef IterableMapExtender<StaticMap<Graph, UpperNode, _Value> > 367 367 Parent; … … 400 400 : public IterableMapExtender<StaticMap<Graph, LowerNode, _Value> > { 401 401 public: 402 typedef StaticMappableU ndirBipartiteGraphExtender Graph;402 typedef StaticMappableUBipartiteGraphExtender Graph; 403 403 typedef IterableMapExtender<StaticMap<Graph, LowerNode, _Value> > 404 404 Parent; … … 438 438 class NodeMapBase : public Parent::NodeNotifier::ObserverBase { 439 439 public: 440 typedef StaticMappableU ndirBipartiteGraphExtender Graph;440 typedef StaticMappableUBipartiteGraphExtender Graph; 441 441 442 442 typedef Node Key; … … 518 518 : public IterableMapExtender<NodeMapBase<_Value> > { 519 519 public: 520 typedef StaticMappableU ndirBipartiteGraphExtender Graph;520 typedef StaticMappableUBipartiteGraphExtender Graph; 521 521 typedef IterableMapExtender< NodeMapBase<_Value> > Parent; 522 522 … … 556 556 : public IterableMapExtender<StaticMap<Graph, Edge, _Value> > { 557 557 public: 558 typedef StaticMappableU ndirBipartiteGraphExtender Graph;558 typedef StaticMappableUBipartiteGraphExtender Graph; 559 559 typedef IterableMapExtender<StaticMap<Graph, Edge, _Value> > Parent; 560 560 … … 581 581 582 582 template <typename _Value> 583 class U ndirEdgeMap584 : public IterableMapExtender<StaticMap<Graph, U ndirEdge, _Value> > {585 public: 586 typedef StaticMappableU ndirBipartiteGraphExtender Graph;587 typedef IterableMapExtender<StaticMap<Graph, U ndirEdge, _Value> >583 class UEdgeMap 584 : public IterableMapExtender<StaticMap<Graph, UEdge, _Value> > { 585 public: 586 typedef StaticMappableUBipartiteGraphExtender Graph; 587 typedef IterableMapExtender<StaticMap<Graph, UEdge, _Value> > 588 588 Parent; 589 589 590 U ndirEdgeMap(const Graph& _g)591 : Parent(_g) {} 592 U ndirEdgeMap(const Graph& _g, const _Value& _v)593 : Parent(_g, _v) {} 594 595 U ndirEdgeMap& operator=(const UndirEdgeMap& cmap) {596 return operator=<U ndirEdgeMap>(cmap);597 } 598 599 template <typename CMap> 600 U ndirEdgeMap& operator=(const CMap& cmap) {601 checkConcept<concept::ReadMap<U ndirEdge, _Value>, CMap>();602 const typename Parent::Graph* graph = Parent::getGraph(); 603 U ndirEdge it;590 UEdgeMap(const Graph& _g) 591 : Parent(_g) {} 592 UEdgeMap(const Graph& _g, const _Value& _v) 593 : Parent(_g, _v) {} 594 595 UEdgeMap& operator=(const UEdgeMap& cmap) { 596 return operator=<UEdgeMap>(cmap); 597 } 598 599 template <typename CMap> 600 UEdgeMap& operator=(const CMap& cmap) { 601 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 602 const typename Parent::Graph* graph = Parent::getGraph(); 603 UEdge it; 604 604 for (graph->first(it); it != INVALID; graph->next(it)) { 605 605 Parent::set(it, cmap[it]);
Note: See TracChangeset
for help on using the changeset viewer.