COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/11/05 17:55:17 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2135
Message:

Some modification on the undirected graph interface.
Doc improvments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/iterable_graph_extender.h

    r1564 r1627  
    119119    };
    120120
    121     /// Base node of the iterator
     121    /// \brief Base node of the iterator
    122122    ///
    123123    /// Returns the base node (ie. the source in this case) of the iterator
    124     ///
    125     /// \todo Document in the concept!
    126124    Node baseNode(const OutEdgeIt &e) const {
    127125      return Parent::source((Edge)e);
    128126    }
    129     /// Running node of the iterator
     127    /// \brief Running node of the iterator
    130128    ///
    131129    /// Returns the running node (ie. the target in this case) of the
    132130    /// iterator
    133     ///
    134     /// \todo Document in the concept!
    135131    Node runningNode(const OutEdgeIt &e) const {
    136132      return Parent::target((Edge)e);
    137133    }
    138134
    139     /// Base node of the iterator
     135    /// \brief Base node of the iterator
    140136    ///
    141137    /// Returns the base node (ie. the target in this case) of the iterator
    142     ///
    143     /// \todo Document in the concept!
    144138    Node baseNode(const InEdgeIt &e) const {
    145139      return Parent::target((Edge)e);
    146140    }
    147     /// Running node of the iterator
     141    /// \brief Running node of the iterator
    148142    ///
    149143    /// Returns the running node (ie. the source in this case) of the
    150144    /// iterator
    151     ///
    152     /// \todo Document in the concept!
    153145    Node runningNode(const InEdgeIt &e) const {
    154146      return Parent::source((Edge)e);
     
    157149    using Parent::first;
    158150
     151    /// \brief The opposite node on the given edge.
     152    ///
     153    /// Gives back the opposite on the given edge.
     154    Node oppositeNode(const Node& n, const Edge& e) const {
     155      if (Parent::source(e) == n) {
     156        return Parent::target(e);
     157      } else {
     158        return Parent::source(e);
     159      }
     160    }
     161
    159162  private:
    160 
    161     // /// \todo When (and if) we change the iterators concept to use operator*,
    162     // /// then the following shadowed methods will become superfluous.
    163     // /// But for now these are important safety measures.
    164163
    165164    // void first(NodeIt &) const;
     
    191190    typedef IterableUndirGraphExtender<_Base> Graph;
    192191    typedef typename Parent::Node Node;
    193 
     192    typedef typename Parent::Edge Edge;
    194193    typedef typename Parent::UndirEdge UndirEdge;
    195194
     
    262261    }
    263262
     263    /// \brief The opposite node on the given undirected edge.
     264    ///
     265    /// Gives back the opposite on the given undirected edge.
     266    Node oppositeNode(const Node& n, const UndirEdge& e) const {
     267      if (Parent::source(e) == n) {
     268        return Parent::target(e);
     269      } else {
     270        return Parent::source(e);
     271      }
     272    }
     273
    264274  };
    265275}
Note: See TracChangeset for help on using the changeset viewer.