COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/bpgraph.h

    r1092 r1130  
    2828#include <lemon/concept_check.h>
    2929#include <lemon/core.h>
     30#include <lemon/bits/stl_iterators.h>
    3031
    3132namespace lemon {
     
    222223      };
    223224
     225      /// \brief Gets the collection of the red nodes of the graph.
     226      ///
     227      /// This function can be used for iterating on
     228      /// the red nodes of the graph. It returns a wrapped RedNodeIt,
     229      /// which looks like an STL container (by having begin() and end())
     230      /// which you can use in range-based for loops, stl algorithms, etc.
     231      /// For example if g is a BpGraph, you can write:
     232      ///\code
     233      /// for(auto v: g.redNodes())
     234      ///   doSomething(v);
     235      ///\endcode
     236      LemonRangeWrapper1<RedNodeIt, BpGraph> redNodes() const {
     237        return LemonRangeWrapper1<RedNodeIt, BpGraph>(*this);
     238      }
     239
     240
    224241      /// Iterator class for the blue nodes.
    225242
     
    265282      };
    266283
     284      /// \brief Gets the collection of the blue nodes of the graph.
     285      ///
     286      /// This function can be used for iterating on
     287      /// the blue nodes of the graph. It returns a wrapped BlueNodeIt,
     288      /// which looks like an STL container (by having begin() and end())
     289      /// which you can use in range-based for loops, stl algorithms, etc.
     290      /// For example if g is a BpGraph, you can write:
     291      ///\code
     292      /// for(auto v: g.blueNodes())
     293      ///   doSomething(v);
     294      ///\endcode
     295      LemonRangeWrapper1<BlueNodeIt, BpGraph> blueNodes() const {
     296        return LemonRangeWrapper1<BlueNodeIt, BpGraph>(*this);
     297      }
     298
     299
    267300      /// Iterator class for the nodes.
    268301
     
    307340        NodeIt& operator++() { return *this; }
    308341      };
     342
     343      /// \brief Gets the collection of the nodes of the graph.
     344      ///
     345      /// This function can be used for iterating on
     346      /// the nodes of the graph. It returns a wrapped NodeIt,
     347      /// which looks like an STL container (by having begin() and end())
     348      /// which you can use in range-based for loops, stl algorithms, etc.
     349      /// For example if g is a BpGraph, you can write:
     350      ///\code
     351      /// for(auto v: g.nodes())
     352      ///   doSomething(v);
     353      ///\endcode
     354      LemonRangeWrapper1<NodeIt, BpGraph> nodes() const {
     355        return LemonRangeWrapper1<NodeIt, BpGraph>(*this);
     356      }
     357
    309358
    310359
     
    395444        EdgeIt& operator++() { return *this; }
    396445      };
     446
     447      /// \brief Gets the collection of the edges of the graph.
     448      ///
     449      /// This function can be used for iterating on the
     450      /// edges of the graph. It returns a wrapped
     451      /// EdgeIt, which looks like an STL container
     452      /// (by having begin() and end()) which you can use in range-based
     453      /// for loops, stl algorithms, etc.
     454      /// For example if g is a BpGraph, you can write:
     455      ///\code
     456      /// for(auto e: g.edges())
     457      ///   doSomething(e);
     458      ///\endcode
     459      LemonRangeWrapper1<EdgeIt, BpGraph> edges() const {
     460        return LemonRangeWrapper1<EdgeIt, BpGraph>(*this);
     461      }
     462
    397463
    398464      /// Iterator class for the incident edges of a node.
     
    444510      };
    445511
     512      /// \brief Gets the collection of the incident edges
     513      ///  of a certain node of the graph.
     514      ///
     515      /// This function can be used for iterating on the
     516      /// incident undirected edges of a certain node of the graph.
     517      /// It returns a wrapped
     518      /// IncEdgeIt, which looks like an STL container
     519      /// (by having begin() and end()) which you can use in range-based
     520      /// for loops, stl algorithms, etc.
     521      /// For example if g is a BpGraph and u is a Node, you can write:
     522      ///\code
     523      /// for(auto e: g.incEdges(u))
     524      ///   doSomething(e);
     525      ///\endcode
     526      LemonRangeWrapper2<IncEdgeIt, BpGraph, Node> incEdges(const Node& u) const {
     527        return LemonRangeWrapper2<IncEdgeIt, BpGraph, Node>(*this, u);
     528      }
     529
     530
    446531      /// The arc type of the graph
    447532
     
    540625      };
    541626
     627      /// \brief Gets the collection of the directed arcs of the graph.
     628      ///
     629      /// This function can be used for iterating on the
     630      /// arcs of the graph. It returns a wrapped
     631      /// ArcIt, which looks like an STL container
     632      /// (by having begin() and end()) which you can use in range-based
     633      /// for loops, stl algorithms, etc.
     634      /// For example if g is a BpGraph you can write:
     635      ///\code
     636      /// for(auto a: g.arcs())
     637      ///   doSomething(a);
     638      ///\endcode
     639      LemonRangeWrapper1<ArcIt, BpGraph> arcs() const {
     640        return LemonRangeWrapper1<ArcIt, BpGraph>(*this);
     641      }
     642
     643
    542644      /// Iterator class for the outgoing arcs of a node.
    543645
     
    588690      };
    589691
     692      /// \brief Gets the collection of the outgoing directed arcs of a
     693      /// certain node of the graph.
     694      ///
     695      /// This function can be used for iterating on the
     696      /// outgoing arcs of a certain node of the graph. It returns a wrapped
     697      /// OutArcIt, which looks like an STL container
     698      /// (by having begin() and end()) which you can use in range-based
     699      /// for loops, stl algorithms, etc.
     700      /// For example if g is a BpGraph and u is a Node, you can write:
     701      ///\code
     702      /// for(auto a: g.outArcs(u))
     703      ///   doSomething(a);
     704      ///\endcode
     705      LemonRangeWrapper2<OutArcIt, BpGraph, Node> outArcs(const Node& u) const {
     706        return LemonRangeWrapper2<OutArcIt, BpGraph, Node>(*this, u);
     707      }
     708
     709
    590710      /// Iterator class for the incoming arcs of a node.
    591711
     
    635755        InArcIt& operator++() { return *this; }
    636756      };
     757
     758      /// \brief Gets the collection of the incoming directed arcs of a
     759      /// certain node of the graph.
     760      ///
     761      /// This function can be used for iterating on the
     762      /// incoming arcs of a certain node of the graph. It returns a wrapped
     763      /// InArcIt, which looks like an STL container
     764      /// (by having begin() and end()) which you can use in range-based
     765      /// for loops, stl algorithms, etc.
     766      /// For example if g is a BpGraph and u is a Node, you can write:
     767      ///\code
     768      /// for(auto a: g.inArcs(u))
     769      ///   doSomething(a);
     770      ///\endcode
     771      LemonRangeWrapper2<InArcIt, BpGraph, Node> inArcs(const Node& u) const {
     772        return LemonRangeWrapper2<InArcIt, BpGraph, Node>(*this, u);
     773      }
     774
    637775
    638776      /// \brief Standard graph map type for the nodes.
Note: See TracChangeset for help on using the changeset viewer.