lemon/bits/edge_set_extender.h
changeset 1141 a037254714b3
parent 1092 dceba191c00d
equal deleted inserted replaced
14:2bfdf1d27ff8 15:4c25a02e1d64
   111         return *this;
   111         return *this;
   112       }
   112       }
   113 
   113 
   114     };
   114     };
   115 
   115 
       
   116     LemonRangeWrapper1<NodeIt, Digraph> nodes() const {
       
   117       return LemonRangeWrapper1<NodeIt, Digraph>(*this);
       
   118     }
   116 
   119 
   117     class ArcIt : public Arc {
   120     class ArcIt : public Arc {
   118       const Digraph* digraph;
   121       const Digraph* digraph;
   119     public:
   122     public:
   120 
   123 
   134         return *this;
   137         return *this;
   135       }
   138       }
   136 
   139 
   137     };
   140     };
   138 
   141 
       
   142     LemonRangeWrapper1<ArcIt, Digraph> arcs() const {
       
   143       return LemonRangeWrapper1<ArcIt, Digraph>(*this);
       
   144     }
   139 
   145 
   140     class OutArcIt : public Arc {
   146     class OutArcIt : public Arc {
   141       const Digraph* digraph;
   147       const Digraph* digraph;
   142     public:
   148     public:
   143 
   149 
   158         return *this;
   164         return *this;
   159       }
   165       }
   160 
   166 
   161     };
   167     };
   162 
   168 
       
   169     LemonRangeWrapper2<OutArcIt, Digraph, Node> outArcs(const Node& u) const {
       
   170       return LemonRangeWrapper2<OutArcIt, Digraph, Node>(*this, u);
       
   171     }
   163 
   172 
   164     class InArcIt : public Arc {
   173     class InArcIt : public Arc {
   165       const Digraph* digraph;
   174       const Digraph* digraph;
   166     public:
   175     public:
   167 
   176 
   181         digraph->nextIn(*this);
   190         digraph->nextIn(*this);
   182         return *this;
   191         return *this;
   183       }
   192       }
   184 
   193 
   185     };
   194     };
       
   195 
       
   196     LemonRangeWrapper2<InArcIt, Digraph, Node> inArcs(const Node& u) const {
       
   197       return LemonRangeWrapper2<InArcIt, Digraph, Node>(*this, u);
       
   198     }
   186 
   199 
   187     // \brief Base node of the iterator
   200     // \brief Base node of the iterator
   188     //
   201     //
   189     // Returns the base node (ie. the source in this case) of the iterator
   202     // Returns the base node (ie. the source in this case) of the iterator
   190     Node baseNode(const OutArcIt &e) const {
   203     Node baseNode(const OutArcIt &e) const {
   370         return *this;
   383         return *this;
   371       }
   384       }
   372 
   385 
   373     };
   386     };
   374 
   387 
       
   388     LemonRangeWrapper1<NodeIt, Graph> nodes() const {
       
   389       return LemonRangeWrapper1<NodeIt, Graph>(*this);
       
   390     }
   375 
   391 
   376     class ArcIt : public Arc {
   392     class ArcIt : public Arc {
   377       const Graph* graph;
   393       const Graph* graph;
   378     public:
   394     public:
   379 
   395 
   393         return *this;
   409         return *this;
   394       }
   410       }
   395 
   411 
   396     };
   412     };
   397 
   413 
       
   414     LemonRangeWrapper1<ArcIt, Graph> arcs() const {
       
   415       return LemonRangeWrapper1<ArcIt, Graph>(*this);
       
   416     }
   398 
   417 
   399     class OutArcIt : public Arc {
   418     class OutArcIt : public Arc {
   400       const Graph* graph;
   419       const Graph* graph;
   401     public:
   420     public:
   402 
   421 
   417         return *this;
   436         return *this;
   418       }
   437       }
   419 
   438 
   420     };
   439     };
   421 
   440 
       
   441     LemonRangeWrapper2<OutArcIt, Graph, Node> outArcs(const Node& u) const {
       
   442       return LemonRangeWrapper2<OutArcIt, Graph, Node>(*this, u);
       
   443     }
   422 
   444 
   423     class InArcIt : public Arc {
   445     class InArcIt : public Arc {
   424       const Graph* graph;
   446       const Graph* graph;
   425     public:
   447     public:
   426 
   448 
   441         return *this;
   463         return *this;
   442       }
   464       }
   443 
   465 
   444     };
   466     };
   445 
   467 
       
   468     LemonRangeWrapper2<InArcIt, Graph, Node> inArcs(const Node& u) const {
       
   469       return LemonRangeWrapper2<InArcIt, Graph, Node>(*this, u);
       
   470     }
   446 
   471 
   447     class EdgeIt : public Parent::Edge {
   472     class EdgeIt : public Parent::Edge {
   448       const Graph* graph;
   473       const Graph* graph;
   449     public:
   474     public:
   450 
   475 
   463         graph->next(*this);
   488         graph->next(*this);
   464         return *this;
   489         return *this;
   465       }
   490       }
   466 
   491 
   467     };
   492     };
       
   493 
       
   494     LemonRangeWrapper1<EdgeIt, Graph> edges() const {
       
   495       return LemonRangeWrapper1<EdgeIt, Graph>(*this);
       
   496     }
   468 
   497 
   469     class IncEdgeIt : public Parent::Edge {
   498     class IncEdgeIt : public Parent::Edge {
   470       friend class EdgeSetExtender;
   499       friend class EdgeSetExtender;
   471       const Graph* graph;
   500       const Graph* graph;
   472       bool direction;
   501       bool direction;
   488       IncEdgeIt& operator++() {
   517       IncEdgeIt& operator++() {
   489         graph->nextInc(*this, direction);
   518         graph->nextInc(*this, direction);
   490         return *this;
   519         return *this;
   491       }
   520       }
   492     };
   521     };
       
   522 
       
   523     LemonRangeWrapper2<IncEdgeIt, Graph, Node> incEdges(const Node& u) const {
       
   524       return LemonRangeWrapper2<IncEdgeIt, Graph, Node>(*this, u);
       
   525     }
   493 
   526 
   494     // \brief Base node of the iterator
   527     // \brief Base node of the iterator
   495     //
   528     //
   496     // Returns the base node (ie. the source in this case) of the iterator
   529     // Returns the base node (ie. the source in this case) of the iterator
   497     Node baseNode(const OutArcIt &e) const {
   530     Node baseNode(const OutArcIt &e) const {