COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
02/20/05 02:02:07 (20 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1559
Message:

Graph and UndirGraph? concept modifications.

  • For incidence iterators ({In,Out,Inc}EdgeIt?) there is now baseNode and runningNode functions in graph interface
  • For Edge in undir graphs: Edge(UndirGraph? const &, UndirEdge?, Node) constructor. Same for IncEdgeIt?
  • Edge(UndirEdge?, bool) constructor is no more in the public interface. (But we need it in the developpers interface).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/iterable_graph_extender.h

    r1030 r1158  
    111111    };
    112112
     113    /// Base node of the iterator
     114    ///
     115    /// Returns the base node (ie. the source in this case) of the iterator
     116    ///
     117    /// \todo Document in the concept!
     118    Node baseNode(const OutEdgeIt &e) const {
     119      return source(e);
     120    }
     121    /// Running node of the iterator
     122    ///
     123    /// Returns the running node (ie. the target in this case) of the
     124    /// iterator
     125    ///
     126    /// \todo Document in the concept!
     127    Node runningNode(const OutEdgeIt &e) const {
     128      return target(e);
     129    }
     130
     131    /// Base node of the iterator
     132    ///
     133    /// Returns the base node (ie. the target in this case) of the iterator
     134    ///
     135    /// \todo Document in the concept!
     136    Node baseNode(const InEdgeIt &e) const {
     137      return target(e);
     138    }
     139    /// Running node of the iterator
     140    ///
     141    /// Returns the running node (ie. the source in this case) of the
     142    /// iterator
     143    ///
     144    /// \todo Document in the concept!
     145    Node runningNode(const InEdgeIt &e) const {
     146      return source(e);
     147    }
     148
    113149    using Parent::first;
    114150
     
    125161
    126162  };
     163
     164
     165
     166
     167
    127168 
    128169  template <typename _Base>
     
    170211      IncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { }
    171212
    172       explicit IncEdgeIt(const Graph& _graph, const Node &n)
     213      IncEdgeIt(const Graph& _graph, const Node &n)
    173214        : graph(&_graph)
    174215      {
     
    176217      }
    177218
    178       // FIXME: Do we need this type of constructor here?
    179       // IncEdgeIt(const Graph& _graph, const Edge& e) :
    180       //   UndirEdge(e), graph(&_graph), forward(_graph.forward(e)) { }
    181       // or
    182       // IncEdgeIt(const Graph& _graph, const Node& n,
    183       //    Const UndirEdge &e) ... ?
     219      IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
     220        : graph(&_graph), UndirEdge(ue)
     221      {
     222        forward = (_graph.source(ue) == n);
     223      }
    184224
    185225      IncEdgeIt& operator++() {
     
    189229    };
    190230
    191     Node source(const IncEdgeIt &e) const {
     231    using Parent::baseNode;
     232    using Parent::runningNode;
     233
     234    /// Base node of the iterator
     235    ///
     236    /// Returns the base node of the iterator
     237    Node baseNode(const IncEdgeIt &e) const {
    192238      return _dirSource(e);
    193239    }
    194 
    195     /// \todo Shouldn't the "source" of an undirected edge be called "aNode"
    196     /// or something???
    197     using Parent::source;
    198 
    199     /// Target of the given Edge.
    200     Node target(const IncEdgeIt &e) const {
     240    /// Running node of the iterator
     241    ///
     242    /// Returns the running node of the iterator
     243    Node runningNode(const IncEdgeIt &e) const {
    201244      return _dirTarget(e);
    202245    }
    203 
    204     /// \todo Shouldn't the "target" of an undirected edge be called "bNode"
    205     /// or something???
    206     using Parent::target;
    207246
    208247  };
Note: See TracChangeset for help on using the changeset viewer.