COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
11/25/04 15:48:24 (19 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1411
Message:

Advances in UndirGraph?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/iterable_graph_extender.h

    r962 r1021  
    132132    typedef IterableGraphExtender<_Base> Parent;
    133133    typedef IterableUndirGraphExtender<_Base> Graph;
     134    typedef typename Parent::Node Node;
    134135
    135136    typedef typename Parent::UndirEdge UndirEdge;
     
    157158    };
    158159
     160    class UndirIncEdgeIt : public UndirEdge {
     161      const Graph* graph;
     162      bool forward;
     163      friend class IterableUndirGraphExtender;
     164      template <typename G>
     165      friend class UndirGraphExtender;
     166    public:
     167
     168      UndirIncEdgeIt() { }
     169
     170      UndirIncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { }
     171
     172      explicit UndirIncEdgeIt(const Graph& _graph, const Node &n)
     173        : graph(&_graph)
     174      {
     175        _graph._dirFirstOut(*this, n);
     176      }
     177
     178      // FIXME: Do we need this type of constructor here?
     179      // UndirIncEdgeIt(const Graph& _graph, const UndirEdge& e) :
     180      //   UndirEdge(e), graph(&_graph) { }
     181
     182      UndirIncEdgeIt& operator++() {
     183        graph->_dirNextOut(*this);
     184        return *this;
     185      }
     186    };
     187
     188    Node source(const UndirIncEdgeIt &e) const {
     189      return _dirSource(e);
     190    }
     191
     192    /// \todo Shouldn't the "source" of an undirected edge be called "aNode"
     193    /// or something???
     194    using Parent::source;
     195
     196    /// Target of the given Edge.
     197    Node target(const UndirIncEdgeIt &e) const {
     198      return _dirTarget(e);
     199    }
     200
     201    /// \todo Shouldn't the "target" of an undirected edge be called "bNode"
     202    /// or something???
     203    using Parent::target;
    159204
    160205  };
Note: See TracChangeset for help on using the changeset viewer.