COIN-OR::LEMON - Graph Library

Ticket #141: c760d691fe3c.patch

File c760d691fe3c.patch, 2.6 KB (added by Peter Kovacs, 11 years ago)
  • lemon/bits/base_extender.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1220387239 -7200
    # Node ID c760d691fe3c47f3f57ee31f18f5aa5ae6fcf965
    # Parent  914c5432be97842b7ed2c1c56052f4147f5155ad
    Bug fix + doc improvement in UndirDigraphExtender (ticket #141)
    
    diff -r 914c5432be97 -r c760d691fe3c lemon/bits/base_extender.h
    a b  
    5959    public:
    6060      Arc() {}
    6161
    62       /// Invalid arc constructor
     62      // Invalid arc constructor
    6363      Arc(Invalid i) : Edge(i), forward(true) {}
    6464
    6565      bool operator==(const Arc &that) const {
     
    7474      }
    7575    };
    7676
     77    /// First node of the edge
     78    Node u(const Edge &e) const {
     79      return Parent::source(e);
     80    }
    7781
    78 
    79     using Parent::source;
    80 
    81     /// Source of the given Arc.
     82    /// Source of the given arc
    8283    Node source(const Arc &e) const {
    8384      return e.forward ? Parent::source(e) : Parent::target(e);
    8485    }
    8586
    86     using Parent::target;
     87    /// Second node of the edge
     88    Node v(const Edge &e) const {
     89      return Parent::target(e);
     90    }
    8791
    88     /// Target of the given Arc.
     92    /// Target of the given arc
    8993    Node target(const Arc &e) const {
    9094      return e.forward ? Parent::target(e) : Parent::source(e);
    9195    }
    9296
    9397    /// \brief Directed arc from an edge.
    9498    ///
    95     /// Returns a directed arc corresponding to the specified Edge.
    96     /// If the given bool is true the given edge and the
    97     /// returned arc have the same source node.
    98     static Arc direct(const Edge &ue, bool d) {
    99       return Arc(ue, d);
     99    /// Returns a directed arc corresponding to the specified edge.
     100    /// If the given bool is true, the first node of the given edge and
     101    /// the source node of the returned arc are the same.
     102    static Arc direct(const Edge &e, bool d) {
     103      return Arc(e, d);
    100104    }
    101105
    102     /// Returns whether the given directed arc is same orientation as the
    103     /// corresponding edge.
     106    /// Returns whether the given directed arc has the same orientation
     107    /// as the corresponding edge.
    104108    ///
    105109    /// \todo reference to the corresponding point of the undirected digraph
    106110    /// concept. "What does the direction of an edge mean?"
    107     static bool direction(const Arc &e) { return e.forward; }
    108 
     111    static bool direction(const Arc &a) { return a.forward; }
    109112
    110113    using Parent::first;
    111114    using Parent::next;
     
    228231    int maxEdgeId() const {
    229232      return Parent::maxArcId();
    230233    }
    231 
    232234
    233235    int arcNum() const {
    234236      return 2 * Parent::arcNum();