COIN-OR::LEMON - Graph Library

Changeset 1336:0759d974de81 in lemon for lemon/concepts/path.h


Ignore:
Timestamp:
01/05/14 22:24:56 (6 years ago)
Author:
Gabor Gevay <ggab90@…>
Branch:
default
Phase:
public
Message:

STL style iterators (#325)

For

  • graph types,
  • graph adaptors,
  • paths,
  • iterable maps,
  • LP rows/cols and
  • active nodes is BellmanFord?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/path.h

    r1270 r1336  
    2727#include <lemon/core.h>
    2828#include <lemon/concept_check.h>
     29#include <lemon/bits/stl_iterators.h>
    2930
    3031namespace lemon {
     
    116117      };
    117118
     119      /// \brief Gets the collection of the arcs of the path.
     120      ///
     121      /// This function can be used for iterating on the
     122      /// arcs of the path. It returns a wrapped
     123      /// ArcIt, which looks like an STL container
     124      /// (by having begin() and end()) which you can use in range-based
     125      /// for loops, STL algorithms, etc.
     126      /// For example you can write:
     127      ///\code
     128      /// for(auto a: p.arcs())
     129      ///   doSomething(a);
     130      ///\endcode
     131      LemonRangeWrapper1<ArcIt, Path> arcs() const {
     132        return LemonRangeWrapper1<ArcIt, Path>(*this);
     133      }
     134
     135
    118136      template <typename _Path>
    119137      struct Constraints {
     
    264282
    265283      };
     284
     285      /// \brief Gets the collection of the arcs of the path.
     286      ///
     287      /// This function can be used for iterating on the
     288      /// arcs of the path. It returns a wrapped
     289      /// ArcIt, which looks like an STL container
     290      /// (by having begin() and end()) which you can use in range-based
     291      /// for loops, STL algorithms, etc.
     292      /// For example you can write:
     293      ///\code
     294      /// for(auto a: p.arcs())
     295      ///   doSomething(a);
     296      ///\endcode
     297      LemonRangeWrapper1<ArcIt, PathDumper> arcs() const {
     298        return LemonRangeWrapper1<ArcIt, PathDumper>(*this);
     299      }
     300
    266301
    267302      /// \brief LEMON style iterator for enumerating the arcs of a path
     
    294329      };
    295330
     331      /// \brief Gets the collection of the arcs of the path
     332      /// in reverse direction.
     333      ///
     334      /// This function can be used for iterating on the
     335      /// arcs of the path in reverse direction. It returns a wrapped
     336      /// RevArcIt, which looks like an STL container
     337      /// (by having begin() and end()) which you can use in range-based
     338      /// for loops, STL algorithms, etc.
     339      /// For example you can write:
     340      ///\code
     341      /// for(auto a: p.revArcs())
     342      ///   doSomething(a);
     343      ///\endcode
     344      LemonRangeWrapper1<RevArcIt, PathDumper> revArcs() const {
     345        return LemonRangeWrapper1<RevArcIt, PathDumper>(*this);
     346      }
     347
     348
    296349      template <typename _Path>
    297350      struct Constraints {
Note: See TracChangeset for help on using the changeset viewer.