lemon/bits/base_extender.h
changeset 256 c760d691fe3c
parent 220 a5d8c039f218
child 280 e7f8647ce760
     1.1 --- a/lemon/bits/base_extender.h	Tue Sep 02 10:23:23 2008 +0100
     1.2 +++ b/lemon/bits/base_extender.h	Tue Sep 02 22:27:19 2008 +0200
     1.3 @@ -59,7 +59,7 @@
     1.4      public:
     1.5        Arc() {}
     1.6  
     1.7 -      /// Invalid arc constructor
     1.8 +      // Invalid arc constructor
     1.9        Arc(Invalid i) : Edge(i), forward(true) {}
    1.10  
    1.11        bool operator==(const Arc &that) const {
    1.12 @@ -74,38 +74,41 @@
    1.13        }
    1.14      };
    1.15  
    1.16 +    /// First node of the edge
    1.17 +    Node u(const Edge &e) const {
    1.18 +      return Parent::source(e);
    1.19 +    }
    1.20  
    1.21 -
    1.22 -    using Parent::source;
    1.23 -
    1.24 -    /// Source of the given Arc.
    1.25 +    /// Source of the given arc
    1.26      Node source(const Arc &e) const {
    1.27        return e.forward ? Parent::source(e) : Parent::target(e);
    1.28      }
    1.29  
    1.30 -    using Parent::target;
    1.31 +    /// Second node of the edge
    1.32 +    Node v(const Edge &e) const {
    1.33 +      return Parent::target(e);
    1.34 +    }
    1.35  
    1.36 -    /// Target of the given Arc.
    1.37 +    /// Target of the given arc
    1.38      Node target(const Arc &e) const {
    1.39        return e.forward ? Parent::target(e) : Parent::source(e);
    1.40      }
    1.41  
    1.42      /// \brief Directed arc from an edge.
    1.43      ///
    1.44 -    /// Returns a directed arc corresponding to the specified Edge.
    1.45 -    /// If the given bool is true the given edge and the
    1.46 -    /// returned arc have the same source node.
    1.47 -    static Arc direct(const Edge &ue, bool d) {
    1.48 -      return Arc(ue, d);
    1.49 +    /// Returns a directed arc corresponding to the specified edge.
    1.50 +    /// If the given bool is true, the first node of the given edge and
    1.51 +    /// the source node of the returned arc are the same.
    1.52 +    static Arc direct(const Edge &e, bool d) {
    1.53 +      return Arc(e, d);
    1.54      }
    1.55  
    1.56 -    /// Returns whether the given directed arc is same orientation as the
    1.57 -    /// corresponding edge.
    1.58 +    /// Returns whether the given directed arc has the same orientation
    1.59 +    /// as the corresponding edge.
    1.60      ///
    1.61      /// \todo reference to the corresponding point of the undirected digraph
    1.62      /// concept. "What does the direction of an edge mean?"
    1.63 -    static bool direction(const Arc &e) { return e.forward; }
    1.64 -
    1.65 +    static bool direction(const Arc &a) { return a.forward; }
    1.66  
    1.67      using Parent::first;
    1.68      using Parent::next;
    1.69 @@ -229,7 +232,6 @@
    1.70        return Parent::maxArcId();
    1.71      }
    1.72  
    1.73 -
    1.74      int arcNum() const {
    1.75        return 2 * Parent::arcNum();
    1.76      }