Changeset 986:e997802b855c in lemon-0.x for src/work/marci/experiment/graph_wrapper.h
- Timestamp:
- 11/13/04 13:53:28 (20 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.h
r921 r986 97 97 It e; first(e, v); return e; } 98 98 99 Node head(const Edge& e) const { return graph->head(e); }100 Node tail(const Edge& e) const { return graph->tail(e); }99 Node target(const Edge& e) const { return graph->target(e); } 100 Node source(const Edge& e) const { return graph->source(e); } 101 101 102 102 template<typename I> bool valid(const I& i) const … … 115 115 116 116 Node addNode() const { return graph->addNode(); } 117 Edge addEdge(const Node& tail, const Node& head) const {118 return graph->addEdge( tail, head); }117 Edge addEdge(const Node& source, const Node& target) const { 118 return graph->addEdge(source, target); } 119 119 120 120 template<typename I> void erase(const I& i) const { graph->erase(i); } … … 246 246 It e; this->first(e, v); return e; } 247 247 248 Node head(const Edge& e) const { return gw.head(e); }249 Node tail(const Edge& e) const { return gw.tail(e); }248 Node target(const Edge& e) const { return gw.target(e); } 249 Node source(const Edge& e) const { return gw.source(e); } 250 250 251 251 template<typename I> bool valid(const I& i) const { return gw.valid(i); } … … 261 261 262 262 Node addNode() const { return gw.addNode(); } 263 Edge addEdge(const Node& tail, const Node& head) const {264 return gw.addEdge( tail, head); }263 Edge addEdge(const Node& source, const Node& target) const { 264 return gw.addEdge(source, target); } 265 265 266 266 template<typename I> void erase(const I& i) const { gw.erase(i); } … … 323 323 // It e; first(e, v); return e; } 324 324 325 // Node head(const Edge& e) const { return graph->tail(e); }326 // Node tail(const Edge& e) const { return graph->head(e); }325 // Node target(const Edge& e) const { return graph->source(e); } 326 // Node source(const Edge& e) const { return graph->target(e); } 327 327 328 328 // template<typename I> bool valid(const I& i) const … … 338 338 339 339 // Node addNode() const { return graph->addNode(); } 340 // Edge addEdge(const Node& tail, const Node& head) const {341 // return graph->addEdge( tail, head); }340 // Edge addEdge(const Node& source, const Node& target) const { 341 // return graph->addEdge(source, target); } 342 342 343 343 // int nodeNum() const { return graph->nodeNum(); } … … 404 404 // // It e; first(e, v); return e; } 405 405 406 // //Node head(const Edge& e) const { return graph->tail(e); }407 // //Node tail(const Edge& e) const { return graph->head(e); }406 // //Node target(const Edge& e) const { return graph->source(e); } 407 // //Node source(const Edge& e) const { return graph->target(e); } 408 408 409 409 // //template<typename I> bool valid(const I& i) const … … 419 419 420 420 // //Node addNode() const { return graph->addNode(); } 421 // //Edge addEdge(const Node& tail, const Node& head) const {422 // // return graph->addEdge( tail, head); }421 // //Edge addEdge(const Node& source, const Node& target) const { 422 // // return graph->addEdge(source, target); } 423 423 424 424 // //int nodeNum() const { return graph->nodeNum(); } … … 468 468 GraphWrapper<GraphWrapper>(_gw) { } 469 469 470 Node head(const Edge& e) const471 { return GraphWrapper<GraphWrapper>:: tail(e); }472 Node tail(const Edge& e) const473 { return GraphWrapper<GraphWrapper>:: head(e); }470 Node target(const Edge& e) const 471 { return GraphWrapper<GraphWrapper>::source(e); } 472 Node source(const Edge& e) const 473 { return GraphWrapper<GraphWrapper>::target(e); } 474 474 }; 475 475 … … 600 600 // OutEdgeIt& next(OutEdgeIt& e) const { 601 601 // if (e.out_or_in) { 602 // Node n=gw. tail(e.out);602 // Node n=gw.source(e.out); 603 603 // gw.next(e.out); 604 604 // if (!gw.valid(e.out)) { … … 613 613 614 614 // Node aNode(const OutEdgeIt& e) const { 615 // if (e.out_or_in) return gw. tail(e); else return gw.head(e); }615 // if (e.out_or_in) return gw.source(e); else return gw.target(e); } 616 616 // Node bNode(const OutEdgeIt& e) const { 617 // if (e.out_or_in) return gw. head(e); else return gw.tail(e); }617 // if (e.out_or_in) return gw.target(e); else return gw.source(e); } 618 618 619 619 // typedef OutEdgeIt InEdgeIt; … … 633 633 // It e; first(e, v); return e; } 634 634 635 // Node head(const Edge& e) const { return gw.head(e); }636 // Node tail(const Edge& e) const { return gw.tail(e); }635 // Node target(const Edge& e) const { return gw.target(e); } 636 // Node source(const Edge& e) const { return gw.source(e); } 637 637 638 638 // template<typename I> bool valid(const I& i) const … … 652 652 // Node addNode() const { return gw.addNode(); } 653 653 // // FIXME: ez igy nem jo, mert nem 654 // // Edge addEdge(const Node& tail, const Node& head) const {655 // // return graph->addEdge( tail, head); }654 // // Edge addEdge(const Node& source, const Node& target) const { 655 // // return graph->addEdge(source, target); } 656 656 657 657 // template<typename I> void erase(const I& i) const { gw.erase(i); } … … 799 799 OutEdgeIt& next(OutEdgeIt& e) const { 800 800 if (e.out_or_in) { 801 Node n=gw. tail(e.out);801 Node n=gw.source(e.out); 802 802 gw.next(e.out); 803 803 if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); } … … 809 809 810 810 EdgeIt& next(EdgeIt& e) const { 811 //NodeIt v= tail(e);811 //NodeIt v=source(e); 812 812 gw.next(e.out); 813 813 while (valid(e.v) && !gw.valid(e.out)) { … … 827 827 It e; first(e, v); return e; } 828 828 829 // Node head(const Edge& e) const { return gw.head(e); }830 // Node tail(const Edge& e) const { return gw.tail(e); }829 // Node target(const Edge& e) const { return gw.target(e); } 830 // Node source(const Edge& e) const { return gw.source(e); } 831 831 832 832 // template<typename I> bool valid(const I& i) const … … 842 842 843 843 Node aNode(const OutEdgeIt& e) const { 844 if (e.out_or_in) return gw. tail(e); else return gw.head(e); }844 if (e.out_or_in) return gw.source(e); else return gw.target(e); } 845 845 Node bNode(const OutEdgeIt& e) const { 846 if (e.out_or_in) return gw. head(e); else return gw.tail(e); }846 if (e.out_or_in) return gw.target(e); else return gw.source(e); } 847 847 848 848 // Node addNode() const { return gw.addNode(); } 849 849 850 850 // FIXME: ez igy nem jo, mert nem 851 // Edge addEdge(const Node& tail, const Node& head) const {852 // return graph->addEdge( tail, head); }851 // Edge addEdge(const Node& source, const Node& target) const { 852 // return graph->addEdge(source, target); } 853 853 854 854 // template<typename I> void erase(const I& i) const { gw.erase(i); } … … 914 914 // It e; first(e, v); return e; } 915 915 916 // Node head(const Edge& e) const { return graph->head(e); }917 // Node tail(const Edge& e) const { return graph->tail(e); }916 // Node target(const Edge& e) const { return graph->target(e); } 917 // Node source(const Edge& e) const { return graph->source(e); } 918 918 919 919 // template<typename I> Node aNode(const I& e) const { … … 929 929 930 930 // Node addNode() { return graph->addNode(); } 931 // Edge addEdge(const Node& tail, const Node& head) {932 // return graph->addEdge( tail, head); }931 // Edge addEdge(const Node& source, const Node& target) { 932 // return graph->addEdge(source, target); } 933 933 934 934 // template<typename I> void erase(const I& i) { graph->erase(i); } … … 1181 1181 } 1182 1182 1183 Node tail(Edge e) const {1183 Node source(Edge e) const { 1184 1184 return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); } 1185 Node head(Edge e) const {1185 Node target(Edge e) const { 1186 1186 return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); } 1187 1187 … … 1312 1312 OutEdgeIt f=e; 1313 1313 this->next(f); 1314 first_out_edges->set(this-> tail(e), f);1314 first_out_edges->set(this->source(e), f); 1315 1315 } 1316 1316 }; … … 1382 1382 // It e; first(e, v); return e; } 1383 1383 1384 // //Node head(const Edge& e) const { return gw.head(e); }1385 // //Node tail(const Edge& e) const { return gw.tail(e); }1384 // //Node target(const Edge& e) const { return gw.target(e); } 1385 // //Node source(const Edge& e) const { return gw.source(e); } 1386 1386 1387 1387 // //template<typename I> bool valid(const I& i) const … … 1397 1397 1398 1398 // //Node addNode() const { return gw.addNode(); } 1399 // //Edge addEdge(const Node& tail, const Node& head) const {1400 // // return gw.addEdge( tail, head); }1399 // //Edge addEdge(const Node& source, const Node& target) const { 1400 // // return gw.addEdge(source, target); } 1401 1401 1402 1402 // //void erase(const OutEdgeIt& e) { 1403 // // first_out_edge(this-> tail(e))=e;1403 // // first_out_edge(this->source(e))=e; 1404 1404 // //} 1405 1405 // void erase(const Edge& e) { 1406 1406 // OutEdgeIt f(e); 1407 1407 // next(f); 1408 // first_out_edges.set(this-> tail(e), f);1408 // first_out_edges.set(this->source(e), f); 1409 1409 // } 1410 1410 // //template<typename I> void erase(const I& i) const { gw.erase(i); } … … 1460 1460 // OutEdgeIt& first(OutEdgeIt& e, const Node& n) const { 1461 1461 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::first(e, n); 1462 // while (valid(e) && (dist.get( tail(e))/*+1!=*/>=dist.get(head(e))))1462 // while (valid(e) && (dist.get(source(e))/*+1!=*/>=dist.get(target(e)))) 1463 1463 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e); 1464 1464 // return e; … … 1471 1471 // OutEdgeIt& next(OutEdgeIt& e) const { 1472 1472 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e); 1473 // while (valid(e) && (dist.get( tail(e))/*+1!*/>=dist.get(head(e))))1473 // while (valid(e) && (dist.get(source(e))/*+1!*/>=dist.get(target(e)))) 1474 1474 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e); 1475 1475 // return e; … … 1483 1483 // OutEdgeIt f(e); 1484 1484 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f); 1485 // while (valid(f) && (dist.get( tail(f))/*+1!=*/>=dist.get(head(f))))1485 // while (valid(f) && (dist.get(source(f))/*+1!=*/>=dist.get(target(f)))) 1486 1486 // ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f); 1487 // first_out_edges.set(this-> tail(e), f);1487 // first_out_edges.set(this->source(e), f); 1488 1488 // } 1489 1489 … … 1508 1508 // It e; first(e, v); return e; } 1509 1509 1510 // //Node head(const Edge& e) const { return gw.head(e); }1511 // //Node tail(const Edge& e) const { return gw.tail(e); }1510 // //Node target(const Edge& e) const { return gw.target(e); } 1511 // //Node source(const Edge& e) const { return gw.source(e); } 1512 1512 1513 1513 // //template<typename I> bool valid(const I& i) const … … 1526 1526 1527 1527 // //Node addNode() const { return gw.addNode(); } 1528 // //Edge addEdge(const Node& tail, const Node& head) const {1529 // // return gw.addEdge( tail, head); }1528 // //Edge addEdge(const Node& source, const Node& target) const { 1529 // // return gw.addEdge(source, target); } 1530 1530 1531 1531 // //template<typename I> void erase(const I& i) const { gw.erase(i); } … … 1670 1670 // It e; first(e, v); return e; } 1671 1671 1672 // Node head(const Edge& e) const { return gw.head(e); }1673 // Node tail(const Edge& e) const { return gw.tail(e); }1672 // Node target(const Edge& e) const { return gw.target(e); } 1673 // Node source(const Edge& e) const { return gw.source(e); } 1674 1674 1675 1675 // template<typename I> Node aNode(const I& e) const { … … 1685 1685 1686 1686 // Node addNode() { return gw.addNode(); } 1687 // Edge addEdge(const Node& tail, const Node& head) {1688 // return gw.addEdge( tail, head); }1687 // Edge addEdge(const Node& source, const Node& target) { 1688 // return gw.addEdge(source, target); } 1689 1689 1690 1690 // template<typename I> void erase(const I& i) { gw.erase(i); }
Note: See TracChangeset
for help on using the changeset viewer.