COIN-OR::LEMON - Graph Library

Ticket #325: stl-iterators-cleanup-d9521d1a0c08.patch

File stl-iterators-cleanup-d9521d1a0c08.patch, 13.4 KB (added by Gábor Gévay, 7 years ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Gabor Gevay <ggab90@gmail.com>
    # Date 1390233021 -3600
    #      Mon Jan 20 16:50:21 2014 +0100
    # Node ID d9521d1a0c08a1ba16af15be9307300c6a9693cc
    # Parent  df948ed5f35f60643b78d4d8340276063b0e1361
    STL style iterators - added missing includes; comment changes; whitespace changes; renamings
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    248248
    249249
    250250INCLUDE(CheckCXXCompilerFlag)
    251 CHECK_CXX_COMPILER_FLAG("-std=c++11" CXX11)
    252 IF(CXX11)
     251CHECK_CXX_COMPILER_FLAG("-std=c++11" CXX11FLAG)
     252IF(CXX11FLAG)
    253253  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    254254ENDIF()
    255255
  • lemon/bellman_ford.h

    diff --git a/lemon/bellman_ford.h b/lemon/bellman_ford.h
    a b  
    2929#include <lemon/error.h>
    3030#include <lemon/maps.h>
    3131#include <lemon/path.h>
     32#include <lemon/bits/stl_iterators.h>
    3233
    3334#include <limits>
    3435
     
    698699    /// find augmenting arcs outgoing from them.
    699700    /// It returns a wrapped ActiveIt, which looks
    700701    /// like an STL container (by having begin() and end())
    701     /// which you can use in range-based for loops, stl algorithms, etc.
     702    /// which you can use in range-based for loops, STL algorithms, etc.
    702703    LemonRangeWrapper1<ActiveIt, BellmanFord>
    703704        activeNodes(const BellmanFord& algorithm) const {
    704705      return LemonRangeWrapper1<ActiveIt, BellmanFord>(algorithm);
  • lemon/bits/stl_iterators.h

    diff --git a/lemon/bits/stl_iterators.h b/lemon/bits/stl_iterators.h
    a b  
    5454  /// \c LIT is the Lemon iterator that will be wrapped
    5555  /// \c P is the type of the parameter of the constructor of \c LIT.
    5656  template<class LIT, class P>
    57   class LemonRangeWrapper1{
     57  class LemonRangeWrapper1 {
    5858    const P &_p;
    5959    typedef LemonItWrapper<LIT> It;
    6060  public:
     
    7979  /// \c P1 and \c P2 are the types of the parameters
    8080  /// of the constructor of \c LIT.
    8181  template<class LIT, class P1, class P2>
    82   class LemonRangeWrapper2{
     82  class LemonRangeWrapper2 {
    8383    const P1 &_p1;
    8484    const P2 &_p2;
    8585    typedef LemonItWrapper<LIT> It;
  • lemon/concepts/bpgraph.h

    diff --git a/lemon/concepts/bpgraph.h b/lemon/concepts/bpgraph.h
    a b  
    2727#include <lemon/concepts/maps.h>
    2828#include <lemon/concept_check.h>
    2929#include <lemon/core.h>
     30#include <lemon/bits/stl_iterators.h>
    3031
    3132namespace lemon {
    3233  namespace concepts {
  • lemon/concepts/digraph.h

    diff --git a/lemon/concepts/digraph.h b/lemon/concepts/digraph.h
    a b  
    153153      /// This function can be used for iterating on
    154154      /// the nodes of the digraph. It returns a wrapped NodeIt, which looks
    155155      /// like an STL container (by having begin() and end())
    156       /// which you can use in range-based for loops, stl algorithms, etc.
     156      /// which you can use in range-based for loops, STL algorithms, etc.
    157157      /// For example you can write:
    158158      ///\code
    159159      /// ListDigraph g;
     
    264264      /// outgoing arcs of a certain node of the digraph. It returns a wrapped
    265265      /// OutArcIt, which looks like an STL container
    266266      /// (by having begin() and end()) which you can use in range-based
    267       /// for loops, stl algorithms, etc.
     267      /// for loops, STL algorithms, etc.
    268268      /// For example if g is a Digraph and u is a node, you can write:
    269269      ///\code
    270270      /// for(auto a: g.outArcs(u))
     
    330330      /// incoming arcs of a certain node of the digraph. It returns a wrapped
    331331      /// InArcIt, which looks like an STL container
    332332      /// (by having begin() and end()) which you can use in range-based
    333       /// for loops, stl algorithms, etc.
     333      /// for loops, STL algorithms, etc.
    334334      /// For example if g is a Digraph and u is a node, you can write:
    335335      ///\code
    336336      /// for(auto a: g.inArcs(u))
     
    395395      /// arcs of the digraph. It returns a wrapped
    396396      /// ArcIt, which looks like an STL container
    397397      /// (by having begin() and end()) which you can use in range-based
    398       /// for loops, stl algorithms, etc.
     398      /// for loops, STL algorithms, etc.
    399399      /// For example you can write:
    400400      ///\code
    401401      /// ListDigraph g;
  • lemon/concepts/graph.h

    diff --git a/lemon/concepts/graph.h b/lemon/concepts/graph.h
    a b  
    2727#include <lemon/concepts/maps.h>
    2828#include <lemon/concept_check.h>
    2929#include <lemon/core.h>
     30#include <lemon/bits/stl_iterators.h>
    3031
    3132namespace lemon {
    3233  namespace concepts {
     
    185186      /// This function can be used for iterating on
    186187      /// the nodes of the graph. It returns a wrapped NodeIt, which looks
    187188      /// like an STL container (by having begin() and end())
    188       /// which you can use in range-based for loops, stl algorithms, etc.
     189      /// which you can use in range-based for loops, STL algorithms, etc.
    189190      /// For example you can write:
    190191      ///\code
    191192      /// ListGraph g;
     
    293294      /// edges of the graph. It returns a wrapped
    294295      /// EdgeIt, which looks like an STL container
    295296      /// (by having begin() and end()) which you can use in range-based
    296       /// for loops, stl algorithms, etc.
     297      /// for loops, STL algorithms, etc.
    297298      /// For example you can write:
    298299      ///\code
    299300      /// ListGraph g;
     
    364365      /// It returns a wrapped
    365366      /// IncEdgeIt, which looks like an STL container
    366367      /// (by having begin() and end()) which you can use in range-based
    367       /// for loops, stl algorithms, etc.
     368      /// for loops, STL algorithms, etc.
    368369      /// For example if g is a Graph and u is a Node, you can write:
    369370      ///\code
    370371      /// for(auto e: g.incEdges(u))
     
    479480      /// arcs of the graph. It returns a wrapped
    480481      /// ArcIt, which looks like an STL container
    481482      /// (by having begin() and end()) which you can use in range-based
    482       /// for loops, stl algorithms, etc.
     483      /// for loops, STL algorithms, etc.
    483484      /// For example you can write:
    484485      ///\code
    485486      /// ListGraph g;
     
    549550      /// outgoing arcs of a certain node of the graph. It returns a wrapped
    550551      /// OutArcIt, which looks like an STL container
    551552      /// (by having begin() and end()) which you can use in range-based
    552       /// for loops, stl algorithms, etc.
     553      /// for loops, STL algorithms, etc.
    553554      /// For example if g is a Graph and u is a Node, you can write:
    554555      ///\code
    555556      /// for(auto a: g.outArcs(u))
     
    618619      /// incoming directed arcs of a certain node of the graph. It returns
    619620      /// a wrapped InArcIt, which looks like an STL container
    620621      /// (by having begin() and end()) which you can use in range-based
    621       /// for loops, stl algorithms, etc.
     622      /// for loops, STL algorithms, etc.
    622623      /// For example if g is a Graph and u is a Node, you can write:
    623624      ///\code
    624625      /// for(auto a: g.inArcs(u))
  • lemon/concepts/path.h

    diff --git a/lemon/concepts/path.h b/lemon/concepts/path.h
    a b  
    2626
    2727#include <lemon/core.h>
    2828#include <lemon/concept_check.h>
     29#include <lemon/bits/stl_iterators.h>
    2930
    3031namespace lemon {
    3132  namespace concepts {
     
    121122      /// arcs of the path. It returns a wrapped
    122123      /// ArcIt, which looks like an STL container
    123124      /// (by having begin() and end()) which you can use in range-based
    124       /// for loops, stl algorithms, etc.
     125      /// for loops, STL algorithms, etc.
    125126      /// For example you can write:
    126127      ///\code
    127128      /// for(auto a: p.arcs())
     
    287288      /// arcs of the path. It returns a wrapped
    288289      /// ArcIt, which looks like an STL container
    289290      /// (by having begin() and end()) which you can use in range-based
    290       /// for loops, stl algorithms, etc.
     291      /// for loops, STL algorithms, etc.
    291292      /// For example you can write:
    292293      ///\code
    293294      /// for(auto a: p.arcs())
     
    334335      /// arcs of the path in reverse direction. It returns a wrapped
    335336      /// RevArcIt, which looks like an STL container
    336337      /// (by having begin() and end()) which you can use in range-based
    337       /// for loops, stl algorithms, etc.
     338      /// for loops, STL algorithms, etc.
    338339      /// For example you can write:
    339340      ///\code
    340341      /// for(auto a: p.revArcs())
  • lemon/lp_base.h

    diff --git a/lemon/lp_base.h b/lemon/lp_base.h
    a b  
    191191    /// This function can be used for iterating on
    192192    /// the columns of the LP problem. It returns a wrapped ColIt, which looks
    193193    /// like an STL container (by having begin() and end())
    194     /// which you can use in range-based for loops, stl algorithms, etc.
     194    /// which you can use in range-based for loops, STL algorithms, etc.
    195195    /// For example you can write:
    196196    ///\code
    197197    /// for(auto c: lp.cols())
     
    301301    /// This function can be used for iterating on
    302302    /// the rows of the LP problem. It returns a wrapped RowIt, which looks
    303303    /// like an STL container (by having begin() and end())
    304     /// which you can use in range-based for loops, stl algorithms, etc.
     304    /// which you can use in range-based for loops, STL algorithms, etc.
    305305    /// For example you can write:
    306306    ///\code
    307307    /// for(auto c: lp.rows())
  • lemon/maps.h

    diff --git a/lemon/maps.h b/lemon/maps.h
    a b  
    25852585    /// \brief STL style iterator for the keys mapped to \c true.
    25862586    ///
    25872587    /// This is an STL style wrapper for \ref TrueIt.
    2588     /// It can be used in range-based for loops, stl algorithms, etc.
     2588    /// It can be used in range-based for loops, STL algorithms, etc.
    25892589    LemonRangeWrapper1<TrueIt, IterableBoolMap>
    25902590    trueKeys() {
    25912591      return LemonRangeWrapper1<TrueIt, IterableBoolMap>(*this);
     
    26342634    /// \brief STL style iterator for the keys mapped to \c false.
    26352635    ///
    26362636    /// This is an STL style wrapper for \ref FalseIt.
    2637     /// It can be used in range-based for loops, stl algorithms, etc.
     2637    /// It can be used in range-based for loops, STL algorithms, etc.
    26382638    LemonRangeWrapper1<FalseIt, IterableBoolMap>
    26392639    falseKeys() {
    26402640      return LemonRangeWrapper1<FalseIt, IterableBoolMap>(*this);
     
    26882688    /// \brief STL style iterator for the keys mapped to a given value.
    26892689    ///
    26902690    /// This is an STL style wrapper for \ref ItemIt.
    2691     /// It can be used in range-based for loops, stl algorithms, etc.
     2691    /// It can be used in range-based for loops, STL algorithms, etc.
    26922692    LemonRangeWrapper2<ItemIt, IterableBoolMap, bool>
    26932693    items(bool value) {
    26942694      return LemonRangeWrapper2<ItemIt, IterableBoolMap, bool>(*this, value);
     
    30383038    /// \brief STL style iterator for the keys with the same value.
    30393039    ///
    30403040    /// This is an STL style wrapper for \ref ItemIt.
    3041     /// It can be used in range-based for loops, stl algorithms, etc.
     3041    /// It can be used in range-based for loops, STL algorithms, etc.
    30423042    LemonRangeWrapper2<ItemIt, IterableIntMap, int>
    30433043    items(int value) {
    30443044      return LemonRangeWrapper2<ItemIt, IterableIntMap, int>(*this, value);
     
    32913291    /// \brief STL style iterator for the keys with the same value.
    32923292    ///
    32933293    /// This is an STL style wrapper for \ref ItemIt.
    3294     /// It can be used in range-based for loops, stl algorithms, etc.
     3294    /// It can be used in range-based for loops, STL algorithms, etc.
    32953295    LemonRangeWrapper2<ItemIt, IterableValueMap, V>
    32963296    items(const V& value) {
    32973297      return LemonRangeWrapper2<ItemIt, IterableValueMap, V>(*this, value);
  • lemon/path.h

    diff --git a/lemon/path.h b/lemon/path.h
    a b  
    3030#include <lemon/error.h>
    3131#include <lemon/core.h>
    3232#include <lemon/concepts/path.h>
     33#include <lemon/bits/stl_iterators.h>
    3334
    3435namespace lemon {
    3536
     
    146147    /// arcs of the path. It returns a wrapped
    147148    /// ArcIt, which looks like an STL container
    148149    /// (by having begin() and end()) which you can use in range-based
    149     /// for loops, stl algorithms, etc.
     150    /// for loops, STL algorithms, etc.
    150151    /// For example you can write:
    151152    ///\code
    152153    /// for(auto a: p.arcs())
     
    368369    /// arcs of the path. It returns a wrapped
    369370    /// ArcIt, which looks like an STL container
    370371    /// (by having begin() and end()) which you can use in range-based
    371     /// for loops, stl algorithms, etc.
     372    /// for loops, STL algorithms, etc.
    372373    /// For example you can write:
    373374    ///\code
    374375    /// for(auto a: p.arcs())
     
    583584    /// arcs of the path. It returns a wrapped
    584585    /// ArcIt, which looks like an STL container
    585586    /// (by having begin() and end()) which you can use in range-based
    586     /// for loops, stl algorithms, etc.
     587    /// for loops, STL algorithms, etc.
    587588    /// For example you can write:
    588589    ///\code
    589590    /// for(auto a: p.arcs())
     
    940941    /// arcs of the path. It returns a wrapped
    941942    /// ArcIt, which looks like an STL container
    942943    /// (by having begin() and end()) which you can use in range-based
    943     /// for loops, stl algorithms, etc.
     944    /// for loops, STL algorithms, etc.
    944945    /// For example you can write:
    945946    ///\code
    946947    /// for(auto a: p.arcs())
     
    12311232  /// nodes of the path. It returns a wrapped
    12321233  /// PathNodeIt, which looks like an STL container
    12331234  /// (by having begin() and end()) which you can use in range-based
    1234   /// for loops, stl algorithms, etc.
     1235  /// for loops, STL algorithms, etc.
    12351236  /// For example you can write:
    12361237  ///\code
    12371238  /// for(auto u: pathNodes(g,p))