lemon/bits/base_extender.h
changeset 497 7d7d9debb29a
parent 289 d91884dcd572
child 361 f58410582b9b
equal deleted inserted replaced
6:eed5b1f57820 7:d6b19cb91aeb
    26 #include <lemon/bits/default_map.h>
    26 #include <lemon/bits/default_map.h>
    27 
    27 
    28 #include <lemon/concept_check.h>
    28 #include <lemon/concept_check.h>
    29 #include <lemon/concepts/maps.h>
    29 #include <lemon/concepts/maps.h>
    30 
    30 
    31 ///\ingroup digraphbits
    31 //\ingroup digraphbits
    32 ///\file
    32 //\file
    33 ///\brief Extenders for the digraph types
    33 //\brief Extenders for the digraph types
    34 namespace lemon {
    34 namespace lemon {
    35 
    35 
    36   /// \ingroup digraphbits
    36   // \ingroup digraphbits
    37   ///
    37   //
    38   /// \brief BaseDigraph to BaseGraph extender
    38   // \brief BaseDigraph to BaseGraph extender
    39   template <typename Base>
    39   template <typename Base>
    40   class UndirDigraphExtender : public Base {
    40   class UndirDigraphExtender : public Base {
    41 
    41 
    42   public:
    42   public:
    43 
    43 
    72         return forward<that.forward ||
    72         return forward<that.forward ||
    73           (!(that.forward<forward) && Edge(*this)<Edge(that));
    73           (!(that.forward<forward) && Edge(*this)<Edge(that));
    74       }
    74       }
    75     };
    75     };
    76 
    76 
    77     /// First node of the edge
    77     // First node of the edge
    78     Node u(const Edge &e) const {
    78     Node u(const Edge &e) const {
    79       return Parent::source(e);
    79       return Parent::source(e);
    80     }
    80     }
    81 
    81 
    82     /// Source of the given arc
    82     // Source of the given arc
    83     Node source(const Arc &e) const {
    83     Node source(const Arc &e) const {
    84       return e.forward ? Parent::source(e) : Parent::target(e);
    84       return e.forward ? Parent::source(e) : Parent::target(e);
    85     }
    85     }
    86 
    86 
    87     /// Second node of the edge
    87     // Second node of the edge
    88     Node v(const Edge &e) const {
    88     Node v(const Edge &e) const {
    89       return Parent::target(e);
    89       return Parent::target(e);
    90     }
    90     }
    91 
    91 
    92     /// Target of the given arc
    92     // Target of the given arc
    93     Node target(const Arc &e) const {
    93     Node target(const Arc &e) const {
    94       return e.forward ? Parent::target(e) : Parent::source(e);
    94       return e.forward ? Parent::target(e) : Parent::source(e);
    95     }
    95     }
    96 
    96 
    97     /// \brief Directed arc from an edge.
    97     // \brief Directed arc from an edge.
    98     ///
    98     //
    99     /// Returns a directed arc corresponding to the specified edge.
    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
   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.
   101     // the source node of the returned arc are the same.
   102     static Arc direct(const Edge &e, bool d) {
   102     static Arc direct(const Edge &e, bool d) {
   103       return Arc(e, d);
   103       return Arc(e, d);
   104     }
   104     }
   105 
   105 
   106     /// Returns whether the given directed arc has the same orientation
   106     // Returns whether the given directed arc has the same orientation
   107     /// as the corresponding edge.
   107     // as the corresponding edge.
   108     static bool direction(const Arc &a) { return a.forward; }
   108     static bool direction(const Arc &a) { return a.forward; }
   109 
   109 
   110     using Parent::first;
   110     using Parent::first;
   111     using Parent::next;
   111     using Parent::next;
   112 
   112