COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
01/26/06 16:42:13 (18 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
Message:

Undir -> U transition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/iterable_graph_extender.h

    r1820 r1909  
    1717    ///
    1818    ///\bug Should it be here?
    19     typedef False UndirTag;
     19    typedef False UTag;
    2020
    2121    typedef _Base Parent;
     
    175175 
    176176  template <typename _Base>
    177   class IterableUndirGraphExtender : public IterableGraphExtender<_Base> {
     177  class IterableUGraphExtender : public IterableGraphExtender<_Base> {
    178178  public:
    179179
     
    185185    ///\bug Should be tested in the concept checker whether it is defined
    186186    ///correctly.
    187     typedef True UndirTag;
     187    typedef True UTag;
    188188
    189189    typedef IterableGraphExtender<_Base> Parent;
    190     typedef IterableUndirGraphExtender<_Base> Graph;
     190    typedef IterableUGraphExtender<_Base> Graph;
    191191    typedef typename Parent::Node Node;
    192192    typedef typename Parent::Edge Edge;
    193     typedef typename Parent::UndirEdge UndirEdge;
    194 
    195     class UndirEdgeIt : public Parent::UndirEdge {
    196       const Graph* graph;
    197     public:
    198 
    199       UndirEdgeIt() { }
    200 
    201       UndirEdgeIt(Invalid i) : UndirEdge(i) { }
    202 
    203       explicit UndirEdgeIt(const Graph& _graph) : graph(&_graph) {
    204         _graph.first(*static_cast<UndirEdge*>(this));
    205       }
    206 
    207       UndirEdgeIt(const Graph& _graph, const UndirEdge& e) :
    208         UndirEdge(e), graph(&_graph) { }
    209 
    210       UndirEdgeIt& operator++() {
     193    typedef typename Parent::UEdge UEdge;
     194
     195    class UEdgeIt : public Parent::UEdge {
     196      const Graph* graph;
     197    public:
     198
     199      UEdgeIt() { }
     200
     201      UEdgeIt(Invalid i) : UEdge(i) { }
     202
     203      explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
     204        _graph.first(*static_cast<UEdge*>(this));
     205      }
     206
     207      UEdgeIt(const Graph& _graph, const UEdge& e) :
     208        UEdge(e), graph(&_graph) { }
     209
     210      UEdgeIt& operator++() {
    211211        graph->next(*this);
    212212        return *this;
     
    215215    };
    216216
    217     class IncEdgeIt : public Parent::UndirEdge {
     217    class IncEdgeIt : public Parent::UEdge {
    218218      const Graph* graph;
    219219      bool direction;
    220       friend class IterableUndirGraphExtender;
     220      friend class IterableUGraphExtender;
    221221    public:
    222222
    223223      IncEdgeIt() { }
    224224
    225       IncEdgeIt(Invalid i) : UndirEdge(i), direction(false) { }
     225      IncEdgeIt(Invalid i) : UEdge(i), direction(false) { }
    226226
    227227      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
     
    229229      }
    230230
    231       IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
    232         : graph(&_graph), UndirEdge(ue) {
     231      IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
     232        : graph(&_graph), UEdge(ue) {
    233233        direction = (_graph.source(ue) == n);
    234234      }
     
    259259    ///
    260260    /// Gives back the opposite on the given undirected edge.
    261     Node oppositeNode(const Node& n, const UndirEdge& e) const {
     261    Node oppositeNode(const Node& n, const UEdge& e) const {
    262262      if (Parent::source(e) == n) {
    263263        return Parent::target(e);
     
    271271
    272272  template <typename _Base>
    273   class IterableUndirBipartiteGraphExtender : public _Base {
     273  class IterableUBipartiteGraphExtender : public _Base {
    274274  public:
    275275    typedef _Base Parent;
    276     typedef IterableUndirBipartiteGraphExtender Graph;
     276    typedef IterableUBipartiteGraphExtender Graph;
    277277   
    278278    typedef typename Parent::Node Node;
     
    280280    typedef typename Parent::LowerNode LowerNode;
    281281    typedef typename Parent::Edge Edge;
    282     typedef typename Parent::UndirEdge UndirEdge;
     282    typedef typename Parent::UEdge UEdge;
    283283 
    284284    class NodeIt : public Node {
     
    305305
    306306    class UpperNodeIt : public Node {
    307       friend class IterableUndirBipartiteGraphExtender;
     307      friend class IterableUBipartiteGraphExtender;
    308308      const Graph* graph;
    309309    public:
     
    327327
    328328    class LowerNodeIt : public Node {
    329       friend class IterableUndirBipartiteGraphExtender;
     329      friend class IterableUBipartiteGraphExtender;
    330330      const Graph* graph;
    331331    public:
     
    349349
    350350    class EdgeIt : public Edge {
    351       friend class IterableUndirBipartiteGraphExtender;
     351      friend class IterableUBipartiteGraphExtender;
    352352      const Graph* graph;
    353353    public:
     
    371371    };
    372372
    373     class UndirEdgeIt : public UndirEdge {
    374       friend class IterableUndirBipartiteGraphExtender;
    375       const Graph* graph;
    376     public:
    377    
    378       UndirEdgeIt() { }
    379    
    380       UndirEdgeIt(Invalid i) : UndirEdge(INVALID) { }
    381    
    382       explicit UndirEdgeIt(const Graph& _graph) : graph(&_graph) {
    383         graph->first(static_cast<UndirEdge&>(*this));
    384       }
    385 
    386       UndirEdgeIt(const Graph& _graph, const UndirEdge& edge)
    387         : UndirEdge(edge), graph(&_graph) { }
    388    
    389       UndirEdgeIt& operator++() {
     373    class UEdgeIt : public UEdge {
     374      friend class IterableUBipartiteGraphExtender;
     375      const Graph* graph;
     376    public:
     377   
     378      UEdgeIt() { }
     379   
     380      UEdgeIt(Invalid i) : UEdge(INVALID) { }
     381   
     382      explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
     383        graph->first(static_cast<UEdge&>(*this));
     384      }
     385
     386      UEdgeIt(const Graph& _graph, const UEdge& edge)
     387        : UEdge(edge), graph(&_graph) { }
     388   
     389      UEdgeIt& operator++() {
    390390        graph->next(*this);
    391391        return *this;
     
    394394
    395395    class OutEdgeIt : public Edge {
    396       friend class IterableUndirBipartiteGraphExtender;
     396      friend class IterableUBipartiteGraphExtender;
    397397      const Graph* graph;
    398398    public:
     
    419419
    420420    class InEdgeIt : public Edge {
    421       friend class IterableUndirBipartiteGraphExtender;
     421      friend class IterableUBipartiteGraphExtender;
    422422      const Graph* graph;
    423423    public:
     
    470470    }
    471471 
    472     class IncEdgeIt : public Parent::UndirEdge {
    473       friend class IterableUndirBipartiteGraphExtender;
     472    class IncEdgeIt : public Parent::UEdge {
     473      friend class IterableUBipartiteGraphExtender;
    474474      const Graph* graph;
    475475      bool direction;
     
    478478      IncEdgeIt() { }
    479479   
    480       IncEdgeIt(Invalid i) : UndirEdge(i), direction(true) { }
     480      IncEdgeIt(Invalid i) : UEdge(i), direction(true) { }
    481481   
    482482      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
     
    484484      }
    485485
    486       IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
    487         : graph(&_graph), UndirEdge(ue) {
     486      IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
     487        : graph(&_graph), UEdge(ue) {
    488488        direction = (graph->source(ue) == n);
    489489      }
Note: See TracChangeset for help on using the changeset viewer.