COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
11/13/04 13:53:28 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
Message:

Naming changes:

  • head -> target
  • tail -> source
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/experiment/graph_wrapper.h

    r921 r986  
    9797      It e; first(e, v); return e; }
    9898
    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); }
    101101
    102102    template<typename I> bool valid(const I& i) const
     
    115115 
    116116    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); }
    119119 
    120120    template<typename I> void erase(const I& i) const { graph->erase(i); }
     
    246246      It e; this->first(e, v); return e; }
    247247
    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); }
    250250
    251251    template<typename I> bool valid(const I& i) const { return gw.valid(i); }
     
    261261 
    262262    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); }
    265265 
    266266    template<typename I> void erase(const I& i) const { gw.erase(i); }
     
    323323//       It e; first(e, v); return e; }
    324324
    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); }
    327327 
    328328//     template<typename I> bool valid(const I& i) const
     
    338338
    339339//     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); }
    342342 
    343343//     int nodeNum() const { return graph->nodeNum(); }
     
    404404//     //  It e; first(e, v); return e; }
    405405
    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); }
    408408 
    409409//     //template<typename I> bool valid(const I& i) const
     
    419419
    420420//     //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); }
    423423 
    424424//     //int nodeNum() const { return graph->nodeNum(); }
     
    468468      GraphWrapper<GraphWrapper>(_gw) { } 
    469469
    470     Node head(const Edge& e) const
    471       { return GraphWrapper<GraphWrapper>::tail(e); }
    472     Node tail(const Edge& e) const
    473       { 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); }
    474474  };
    475475
     
    600600//     OutEdgeIt& next(OutEdgeIt& e) const {
    601601//       if (e.out_or_in) {
    602 //      Node n=gw.tail(e.out);
     602//      Node n=gw.source(e.out);
    603603//      gw.next(e.out);
    604604//      if (!gw.valid(e.out)) {
     
    613613
    614614//     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); }
    616616//     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); }
    618618
    619619//     typedef OutEdgeIt InEdgeIt;
     
    633633//       It e; first(e, v); return e; }
    634634
    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); }
    637637
    638638//     template<typename I> bool valid(const I& i) const
     
    652652//     Node addNode() const { return gw.addNode(); }
    653653// // 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); }
    656656 
    657657//     template<typename I> void erase(const I& i) const { gw.erase(i); }
     
    799799    OutEdgeIt& next(OutEdgeIt& e) const {
    800800      if (e.out_or_in) {
    801         Node n=gw.tail(e.out);
     801        Node n=gw.source(e.out);
    802802        gw.next(e.out);
    803803        if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); }
     
    809809
    810810    EdgeIt& next(EdgeIt& e) const {
    811       //NodeIt v=tail(e);
     811      //NodeIt v=source(e);
    812812      gw.next(e.out);
    813813      while (valid(e.v) && !gw.valid(e.out)) {
     
    827827      It e; first(e, v); return e; }
    828828
    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); }
    831831
    832832//    template<typename I> bool valid(const I& i) const
     
    842842
    843843    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); }
    845845    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); }
    847847 
    848848//    Node addNode() const { return gw.addNode(); }
    849849
    850850// 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); }
    853853 
    854854//    template<typename I> void erase(const I& i) const { gw.erase(i); }
     
    914914//       It e; first(e, v); return e; }
    915915
    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); }
    918918 
    919919//     template<typename I> Node aNode(const I& e) const {
     
    929929 
    930930//     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); }
    933933 
    934934//     template<typename I> void erase(const I& i) { graph->erase(i); }
     
    11811181    }
    11821182
    1183     Node tail(Edge e) const {
     1183    Node source(Edge e) const {
    11841184      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 {
    11861186      return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); }
    11871187
     
    13121312      OutEdgeIt f=e;
    13131313      this->next(f);
    1314       first_out_edges->set(this->tail(e), f);
     1314      first_out_edges->set(this->source(e), f);
    13151315    }
    13161316  };
     
    13821382//       It e; first(e, v); return e; }
    13831383
    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); }
    13861386
    13871387//     //template<typename I> bool valid(const I& i) const
     
    13971397 
    13981398//     //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); }
    14011401 
    14021402//     //void erase(const OutEdgeIt& e) {
    1403 //     //  first_out_edge(this->tail(e))=e;
     1403//     //  first_out_edge(this->source(e))=e;
    14041404//     //}
    14051405//     void erase(const Edge& e) {
    14061406//       OutEdgeIt f(e);
    14071407//       next(f);
    1408 //       first_out_edges.set(this->tail(e), f);
     1408//       first_out_edges.set(this->source(e), f);
    14091409//     }
    14101410//     //template<typename I> void erase(const I& i) const { gw.erase(i); }
     
    14601460//     OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
    14611461//       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))))
    14631463//      ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
    14641464//       return e;
     
    14711471//     OutEdgeIt& next(OutEdgeIt& e) const {
    14721472//       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))))
    14741474//      ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
    14751475//       return e;
     
    14831483//       OutEdgeIt f(e);
    14841484//       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))))
    14861486//      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);
    14881488//     }
    14891489
     
    15081508//       It e; first(e, v); return e; }
    15091509
    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); }
    15121512
    15131513//     //template<typename I> bool valid(const I& i) const
     
    15261526 
    15271527//     //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); }
    15301530 
    15311531//     //template<typename I> void erase(const I& i) const { gw.erase(i); }
     
    16701670//       It e; first(e, v); return e; }
    16711671
    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); }
    16741674 
    16751675//     template<typename I> Node aNode(const I& e) const {
     
    16851685 
    16861686//     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); }
    16891689 
    16901690//     template<typename I> void erase(const I& i) { gw.erase(i); }
Note: See TracChangeset for help on using the changeset viewer.