COIN-OR::LEMON - Graph Library

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

findUndirEdge, ConUndirEdgeIt?
some modification in the undir graph extenders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/iterable_graph_extender.h

    r1627 r1704  
    217217    class IncEdgeIt : public Parent::UndirEdge {
    218218      const Graph* graph;
    219       bool forward;
     219      bool direction;
    220220      friend class IterableUndirGraphExtender;
    221       template <typename G>
    222       friend class UndirGraphExtender;
    223221    public:
    224222
    225223      IncEdgeIt() { }
    226224
    227       IncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { }
    228 
    229       IncEdgeIt(const Graph& _graph, const Node &n)
    230         : graph(&_graph)
    231       {
    232         _graph._dirFirstOut(*this, n);
     225      IncEdgeIt(Invalid i) : UndirEdge(i), direction(false) { }
     226
     227      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
     228        _graph.firstInc(*this, direction, n);
    233229      }
    234230
    235231      IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
    236         : graph(&_graph), UndirEdge(ue)
    237       {
    238         forward = (_graph.source(ue) == n);
     232        : graph(&_graph), UndirEdge(ue) {
     233        direction = (_graph.source(ue) == n);
    239234      }
    240235
    241236      IncEdgeIt& operator++() {
    242         graph->_dirNextOut(*this);
     237        graph->nextInc(*this, direction);
    243238        return *this;
    244239      }
     
    252247    /// Returns the base node of the iterator
    253248    Node baseNode(const IncEdgeIt &e) const {
    254       return _dirSource(e);
     249      return e.direction ? source(e) : target(e);
    255250    }
    256251    /// Running node of the iterator
     
    258253    /// Returns the running node of the iterator
    259254    Node runningNode(const IncEdgeIt &e) const {
    260       return _dirTarget(e);
     255      return e.direction ? target(e) : source(e);
    261256    }
    262257
Note: See TracChangeset for help on using the changeset viewer.