Changeset 986:e997802b855c in lemon-0.x for src/work/marci/experiment/graph_wrapper_1.h
- Timestamp:
- 11/13/04 13:53:28 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/experiment/graph_wrapper_1.h
r921 r986 91 91 It e; this->first(e, v); return e; } 92 92 93 Node head(const Edge& e) const { return graph->head(e); }94 Node tail(const Edge& e) const { return graph->tail(e); }93 Node target(const Edge& e) const { return graph->target(e); } 94 Node source(const Edge& e) const { return graph->source(e); } 95 95 96 96 template<typename I> bool valid(const I& i) const { … … 109 109 110 110 Node addNode() const { return graph->addNode(); } 111 Edge addEdge(const Node& tail, const Node& head) const {112 return graph->addEdge( tail, head); }111 Edge addEdge(const Node& source, const Node& target) const { 112 return graph->addEdge(source, target); } 113 113 114 114 template<typename I> void erase(const I& i) const { graph->erase(i); } … … 236 236 It e; this->first(e, v); return e; } 237 237 238 Node head(const Edge& e) const { return graph->head(e); }239 Node tail(const Edge& e) const { return graph->tail(e); }238 Node target(const Edge& e) const { return graph->target(e); } 239 Node source(const Edge& e) const { return graph->source(e); } 240 240 241 241 template<typename I> bool valid(const I& i) const { … … 254 254 255 255 Node addNode() const { return graph->addNode(); } 256 Edge addEdge(const Node& tail, const Node& head) const {257 return graph->addEdge( tail, head); }256 Edge addEdge(const Node& source, const Node& target) const { 257 return graph->addEdge(source, target); } 258 258 259 259 template<typename I> void erase(const I& i) const { graph->erase(i); } … … 317 317 // It e; first(e, v); return e; } 318 318 319 // Node head(const Edge& e) const { return graph->tail(e); }320 // Node tail(const Edge& e) const { return graph->head(e); }319 // Node target(const Edge& e) const { return graph->source(e); } 320 // Node source(const Edge& e) const { return graph->target(e); } 321 321 322 322 // template<typename I> bool valid(const I& i) const … … 332 332 333 333 // Node addNode() const { return graph->addNode(); } 334 // Edge addEdge(const Node& tail, const Node& head) const {335 // return graph->addEdge( tail, head); }334 // Edge addEdge(const Node& source, const Node& target) const { 335 // return graph->addEdge(source, target); } 336 336 337 337 // int nodeNum() const { return graph->nodeNum(); } … … 379 379 RevGraphWrapper(Graph& _graph) : GraphWrapper<Graph>(_graph) { } 380 380 381 Node head(const Edge& e) const382 { return GraphWrapper<Graph>:: tail(e); }383 Node tail(const Edge& e) const384 { return GraphWrapper<Graph>:: head(e); }381 Node target(const Edge& e) const 382 { return GraphWrapper<Graph>::source(e); } 383 Node source(const Edge& e) const 384 { return GraphWrapper<Graph>::target(e); } 385 385 }; 386 386 … … 512 512 // OutEdgeIt& next(OutEdgeIt& e) const { 513 513 // if (e.out_or_in) { 514 // Node n=gw. tail(e.out);514 // Node n=gw.source(e.out); 515 515 // gw.next(e.out); 516 516 // if (!gw.valid(e.out)) { … … 525 525 526 526 // Node aNode(const OutEdgeIt& e) const { 527 // if (e.out_or_in) return gw. tail(e); else return gw.head(e); }527 // if (e.out_or_in) return gw.source(e); else return gw.target(e); } 528 528 // Node bNode(const OutEdgeIt& e) const { 529 // if (e.out_or_in) return gw. head(e); else return gw.tail(e); }529 // if (e.out_or_in) return gw.target(e); else return gw.source(e); } 530 530 531 531 // typedef OutEdgeIt InEdgeIt; … … 545 545 // It e; first(e, v); return e; } 546 546 547 // Node head(const Edge& e) const { return gw.head(e); }548 // Node tail(const Edge& e) const { return gw.tail(e); }547 // Node target(const Edge& e) const { return gw.target(e); } 548 // Node source(const Edge& e) const { return gw.source(e); } 549 549 550 550 // template<typename I> bool valid(const I& i) const … … 564 564 // Node addNode() const { return gw.addNode(); } 565 565 // // FIXME: ez igy nem jo, mert nem 566 // // Edge addEdge(const Node& tail, const Node& head) const {567 // // return graph->addEdge( tail, head); }566 // // Edge addEdge(const Node& source, const Node& target) const { 567 // // return graph->addEdge(source, target); } 568 568 569 569 // template<typename I> void erase(const I& i) const { gw.erase(i); } … … 693 693 OutEdgeIt& next(OutEdgeIt& e) const { 694 694 if (e.out_or_in) { 695 Node n=graph-> tail(e.out);695 Node n=graph->source(e.out); 696 696 graph->next(e.out); 697 697 if (!graph->valid(e.out)) { e.out_or_in=false; graph->first(e.in, n); } … … 703 703 704 704 EdgeIt& next(EdgeIt& e) const { 705 //NodeIt v= tail(e);705 //NodeIt v=source(e); 706 706 graph->next(e.out); 707 707 while (valid(e.v) && !graph->valid(e.out)) { … … 721 721 It e; this->first(e, v); return e; } 722 722 723 // Node head(const Edge& e) const { return gw.head(e); }724 // Node tail(const Edge& e) const { return gw.tail(e); }723 // Node target(const Edge& e) const { return gw.target(e); } 724 // Node source(const Edge& e) const { return gw.source(e); } 725 725 726 726 // template<typename I> bool valid(const I& i) const … … 736 736 737 737 Node aNode(const OutEdgeIt& e) const { 738 if (e.out_or_in) return graph-> tail(e); else return graph->head(e); }738 if (e.out_or_in) return graph->source(e); else return graph->target(e); } 739 739 Node bNode(const OutEdgeIt& e) const { 740 if (e.out_or_in) return graph-> head(e); else return graph->tail(e); }740 if (e.out_or_in) return graph->target(e); else return graph->source(e); } 741 741 742 742 // Node addNode() const { return gw.addNode(); } 743 743 744 744 // FIXME: ez igy nem jo, mert nem 745 // Edge addEdge(const Node& tail, const Node& head) const {746 // return graph->addEdge( tail, head); }745 // Edge addEdge(const Node& source, const Node& target) const { 746 // return graph->addEdge(source, target); } 747 747 748 748 // template<typename I> void erase(const I& i) const { gw.erase(i); } … … 808 808 // It e; first(e, v); return e; } 809 809 810 // Node head(const Edge& e) const { return graph->head(e); }811 // Node tail(const Edge& e) const { return graph->tail(e); }810 // Node target(const Edge& e) const { return graph->target(e); } 811 // Node source(const Edge& e) const { return graph->source(e); } 812 812 813 813 // template<typename I> Node aNode(const I& e) const { … … 823 823 824 824 // Node addNode() { return graph->addNode(); } 825 // Edge addEdge(const Node& tail, const Node& head) {826 // return graph->addEdge( tail, head); }825 // Edge addEdge(const Node& source, const Node& target) { 826 // return graph->addEdge(source, target); } 827 827 828 828 // template<typename I> void erase(const I& i) { graph->erase(i); } … … 1064 1064 } 1065 1065 1066 Node tail(Edge e) const {1066 Node source(Edge e) const { 1067 1067 return ((e.out_or_in) ? graph->aNode(e.out) : graph->aNode(e.in)); } 1068 Node head(Edge e) const {1068 Node target(Edge e) const { 1069 1069 return ((e.out_or_in) ? graph->bNode(e.out) : graph->bNode(e.in)); } 1070 1070 … … 1193 1193 OutEdgeIt f=e; 1194 1194 this->next(f); 1195 first_out_edges->set(this-> tail(e), f);1195 first_out_edges->set(this->source(e), f); 1196 1196 } 1197 1197 }; … … 1311 1311 // It e; first(e, v); return e; } 1312 1312 1313 // Node head(const Edge& e) const { return gw.head(e); }1314 // Node tail(const Edge& e) const { return gw.tail(e); }1313 // Node target(const Edge& e) const { return gw.target(e); } 1314 // Node source(const Edge& e) const { return gw.source(e); } 1315 1315 1316 1316 // template<typename I> Node aNode(const I& e) const { … … 1326 1326 1327 1327 // Node addNode() { return gw.addNode(); } 1328 // Edge addEdge(const Node& tail, const Node& head) {1329 // return gw.addEdge( tail, head); }1328 // Edge addEdge(const Node& source, const Node& target) { 1329 // return gw.addEdge(source, target); } 1330 1330 1331 1331 // template<typename I> void erase(const I& i) { gw.erase(i); }
Note: See TracChangeset
for help on using the changeset viewer.