Changes in lemon/concepts/graph.h [1336:0759d974de81:1271:fb1c7da561ce] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/concepts/graph.h
r1336 r1271 28 28 #include <lemon/concept_check.h> 29 29 #include <lemon/core.h> 30 #include <lemon/bits/stl_iterators.h>31 30 32 31 namespace lemon { … … 182 181 }; 183 182 184 /// \brief Gets the collection of the nodes of the graph.185 ///186 /// This function can be used for iterating on187 /// the nodes of the graph. It returns a wrapped NodeIt, which looks188 /// like an STL container (by having begin() and end())189 /// which you can use in range-based for loops, STL algorithms, etc.190 /// For example you can write:191 ///\code192 /// ListGraph g;193 /// for(auto v: g.nodes())194 /// doSomething(v);195 ///196 /// //Using an STL algorithm:197 /// copy(g.nodes().begin(), g.nodes().end(), vect.begin());198 ///\endcode199 LemonRangeWrapper1<NodeIt, Graph> nodes() const {200 return LemonRangeWrapper1<NodeIt, Graph>(*this);201 }202 203 183 204 184 /// The edge type of the graph … … 289 269 }; 290 270 291 /// \brief Gets the collection of the edges of the graph.292 ///293 /// This function can be used for iterating on the294 /// edges of the graph. It returns a wrapped295 /// EdgeIt, which looks like an STL container296 /// (by having begin() and end()) which you can use in range-based297 /// for loops, STL algorithms, etc.298 /// For example you can write:299 ///\code300 /// ListGraph g;301 /// for(auto e: g.edges())302 /// doSomething(e);303 ///304 /// //Using an STL algorithm:305 /// copy(g.edges().begin(), g.edges().end(), vect.begin());306 ///\endcode307 LemonRangeWrapper1<EdgeIt, Graph> edges() const {308 return LemonRangeWrapper1<EdgeIt, Graph>(*this);309 }310 311 312 271 /// Iterator class for the incident edges of a node. 313 272 … … 357 316 IncEdgeIt& operator++() { return *this; } 358 317 }; 359 360 /// \brief Gets the collection of the incident undirected edges361 /// of a certain node of the graph.362 ///363 /// This function can be used for iterating on the364 /// incident undirected edges of a certain node of the graph.365 /// It returns a wrapped366 /// IncEdgeIt, which looks like an STL container367 /// (by having begin() and end()) which you can use in range-based368 /// for loops, STL algorithms, etc.369 /// For example if g is a Graph and u is a Node, you can write:370 ///\code371 /// for(auto e: g.incEdges(u))372 /// doSomething(e);373 ///374 /// //Using an STL algorithm:375 /// copy(g.incEdges(u).begin(), g.incEdges(u).end(), vect.begin());376 ///\endcode377 LemonRangeWrapper2<IncEdgeIt, Graph, Node> incEdges(const Node& u) const {378 return LemonRangeWrapper2<IncEdgeIt, Graph, Node>(*this, u);379 }380 381 318 382 319 /// The arc type of the graph … … 474 411 ArcIt& operator++() { return *this; } 475 412 }; 476 477 /// \brief Gets the collection of the directed arcs of the graph.478 ///479 /// This function can be used for iterating on the480 /// arcs of the graph. It returns a wrapped481 /// ArcIt, which looks like an STL container482 /// (by having begin() and end()) which you can use in range-based483 /// for loops, STL algorithms, etc.484 /// For example you can write:485 ///\code486 /// ListGraph g;487 /// for(auto a: g.arcs())488 /// doSomething(a);489 ///490 /// //Using an STL algorithm:491 /// copy(g.arcs().begin(), g.arcs().end(), vect.begin());492 ///\endcode493 LemonRangeWrapper1<ArcIt, Graph> arcs() const {494 return LemonRangeWrapper1<ArcIt, Graph>(*this);495 }496 497 413 498 414 /// Iterator class for the outgoing arcs of a node. … … 544 460 }; 545 461 546 /// \brief Gets the collection of the outgoing directed arcs of a547 /// certain node of the graph.548 ///549 /// This function can be used for iterating on the550 /// outgoing arcs of a certain node of the graph. It returns a wrapped551 /// OutArcIt, which looks like an STL container552 /// (by having begin() and end()) which you can use in range-based553 /// for loops, STL algorithms, etc.554 /// For example if g is a Graph and u is a Node, you can write:555 ///\code556 /// for(auto a: g.outArcs(u))557 /// doSomething(a);558 ///559 /// //Using an STL algorithm:560 /// copy(g.outArcs(u).begin(), g.outArcs(u).end(), vect.begin());561 ///\endcode562 LemonRangeWrapper2<OutArcIt, Graph, Node> outArcs(const Node& u) const {563 return LemonRangeWrapper2<OutArcIt, Graph, Node>(*this, u);564 }565 566 567 462 /// Iterator class for the incoming arcs of a node. 568 463 … … 613 508 }; 614 509 615 /// \brief Gets the collection of the incoming directed arcs of616 /// a certain node of the graph.617 ///618 /// This function can be used for iterating on the619 /// incoming directed arcs of a certain node of the graph. It returns620 /// a wrapped InArcIt, which looks like an STL container621 /// (by having begin() and end()) which you can use in range-based622 /// for loops, STL algorithms, etc.623 /// For example if g is a Graph and u is a Node, you can write:624 ///\code625 /// for(auto a: g.inArcs(u))626 /// doSomething(a);627 ///628 /// //Using an STL algorithm:629 /// copy(g.inArcs(u).begin(), g.inArcs(u).end(), vect.begin());630 ///\endcode631 LemonRangeWrapper2<InArcIt, Graph, Node> inArcs(const Node& u) const {632 return LemonRangeWrapper2<InArcIt, Graph, Node>(*this, u);633 }634 635 510 /// \brief Standard graph map type for the nodes. 636 511 ///
Note: See TracChangeset
for help on using the changeset viewer.