# 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
|
|
248 | 248 | |
249 | 249 | |
250 | 250 | INCLUDE(CheckCXXCompilerFlag) |
251 | | CHECK_CXX_COMPILER_FLAG("-std=c++11" CXX11) |
252 | | IF(CXX11) |
| 251 | CHECK_CXX_COMPILER_FLAG("-std=c++11" CXX11FLAG) |
| 252 | IF(CXX11FLAG) |
253 | 253 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
254 | 254 | ENDIF() |
255 | 255 | |
diff --git a/lemon/bellman_ford.h b/lemon/bellman_ford.h
a
|
b
|
|
29 | 29 | #include <lemon/error.h> |
30 | 30 | #include <lemon/maps.h> |
31 | 31 | #include <lemon/path.h> |
| 32 | #include <lemon/bits/stl_iterators.h> |
32 | 33 | |
33 | 34 | #include <limits> |
34 | 35 | |
… |
… |
|
698 | 699 | /// find augmenting arcs outgoing from them. |
699 | 700 | /// It returns a wrapped ActiveIt, which looks |
700 | 701 | /// 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. |
702 | 703 | LemonRangeWrapper1<ActiveIt, BellmanFord> |
703 | 704 | activeNodes(const BellmanFord& algorithm) const { |
704 | 705 | return LemonRangeWrapper1<ActiveIt, BellmanFord>(algorithm); |
diff --git a/lemon/bits/stl_iterators.h b/lemon/bits/stl_iterators.h
a
|
b
|
|
54 | 54 | /// \c LIT is the Lemon iterator that will be wrapped |
55 | 55 | /// \c P is the type of the parameter of the constructor of \c LIT. |
56 | 56 | template<class LIT, class P> |
57 | | class LemonRangeWrapper1{ |
| 57 | class LemonRangeWrapper1 { |
58 | 58 | const P &_p; |
59 | 59 | typedef LemonItWrapper<LIT> It; |
60 | 60 | public: |
… |
… |
|
79 | 79 | /// \c P1 and \c P2 are the types of the parameters |
80 | 80 | /// of the constructor of \c LIT. |
81 | 81 | template<class LIT, class P1, class P2> |
82 | | class LemonRangeWrapper2{ |
| 82 | class LemonRangeWrapper2 { |
83 | 83 | const P1 &_p1; |
84 | 84 | const P2 &_p2; |
85 | 85 | typedef LemonItWrapper<LIT> It; |
diff --git a/lemon/concepts/bpgraph.h b/lemon/concepts/bpgraph.h
a
|
b
|
|
27 | 27 | #include <lemon/concepts/maps.h> |
28 | 28 | #include <lemon/concept_check.h> |
29 | 29 | #include <lemon/core.h> |
| 30 | #include <lemon/bits/stl_iterators.h> |
30 | 31 | |
31 | 32 | namespace lemon { |
32 | 33 | namespace concepts { |
diff --git a/lemon/concepts/digraph.h b/lemon/concepts/digraph.h
a
|
b
|
|
153 | 153 | /// This function can be used for iterating on |
154 | 154 | /// the nodes of the digraph. It returns a wrapped NodeIt, which looks |
155 | 155 | /// 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. |
157 | 157 | /// For example you can write: |
158 | 158 | ///\code |
159 | 159 | /// ListDigraph g; |
… |
… |
|
264 | 264 | /// outgoing arcs of a certain node of the digraph. It returns a wrapped |
265 | 265 | /// OutArcIt, which looks like an STL container |
266 | 266 | /// (by having begin() and end()) which you can use in range-based |
267 | | /// for loops, stl algorithms, etc. |
| 267 | /// for loops, STL algorithms, etc. |
268 | 268 | /// For example if g is a Digraph and u is a node, you can write: |
269 | 269 | ///\code |
270 | 270 | /// for(auto a: g.outArcs(u)) |
… |
… |
|
330 | 330 | /// incoming arcs of a certain node of the digraph. It returns a wrapped |
331 | 331 | /// InArcIt, which looks like an STL container |
332 | 332 | /// (by having begin() and end()) which you can use in range-based |
333 | | /// for loops, stl algorithms, etc. |
| 333 | /// for loops, STL algorithms, etc. |
334 | 334 | /// For example if g is a Digraph and u is a node, you can write: |
335 | 335 | ///\code |
336 | 336 | /// for(auto a: g.inArcs(u)) |
… |
… |
|
395 | 395 | /// arcs of the digraph. It returns a wrapped |
396 | 396 | /// ArcIt, which looks like an STL container |
397 | 397 | /// (by having begin() and end()) which you can use in range-based |
398 | | /// for loops, stl algorithms, etc. |
| 398 | /// for loops, STL algorithms, etc. |
399 | 399 | /// For example you can write: |
400 | 400 | ///\code |
401 | 401 | /// ListDigraph g; |
diff --git a/lemon/concepts/graph.h b/lemon/concepts/graph.h
a
|
b
|
|
27 | 27 | #include <lemon/concepts/maps.h> |
28 | 28 | #include <lemon/concept_check.h> |
29 | 29 | #include <lemon/core.h> |
| 30 | #include <lemon/bits/stl_iterators.h> |
30 | 31 | |
31 | 32 | namespace lemon { |
32 | 33 | namespace concepts { |
… |
… |
|
185 | 186 | /// This function can be used for iterating on |
186 | 187 | /// the nodes of the graph. It returns a wrapped NodeIt, which looks |
187 | 188 | /// 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. |
189 | 190 | /// For example you can write: |
190 | 191 | ///\code |
191 | 192 | /// ListGraph g; |
… |
… |
|
293 | 294 | /// edges of the graph. It returns a wrapped |
294 | 295 | /// EdgeIt, which looks like an STL container |
295 | 296 | /// (by having begin() and end()) which you can use in range-based |
296 | | /// for loops, stl algorithms, etc. |
| 297 | /// for loops, STL algorithms, etc. |
297 | 298 | /// For example you can write: |
298 | 299 | ///\code |
299 | 300 | /// ListGraph g; |
… |
… |
|
364 | 365 | /// It returns a wrapped |
365 | 366 | /// IncEdgeIt, which looks like an STL container |
366 | 367 | /// (by having begin() and end()) which you can use in range-based |
367 | | /// for loops, stl algorithms, etc. |
| 368 | /// for loops, STL algorithms, etc. |
368 | 369 | /// For example if g is a Graph and u is a Node, you can write: |
369 | 370 | ///\code |
370 | 371 | /// for(auto e: g.incEdges(u)) |
… |
… |
|
479 | 480 | /// arcs of the graph. It returns a wrapped |
480 | 481 | /// ArcIt, which looks like an STL container |
481 | 482 | /// (by having begin() and end()) which you can use in range-based |
482 | | /// for loops, stl algorithms, etc. |
| 483 | /// for loops, STL algorithms, etc. |
483 | 484 | /// For example you can write: |
484 | 485 | ///\code |
485 | 486 | /// ListGraph g; |
… |
… |
|
549 | 550 | /// outgoing arcs of a certain node of the graph. It returns a wrapped |
550 | 551 | /// OutArcIt, which looks like an STL container |
551 | 552 | /// (by having begin() and end()) which you can use in range-based |
552 | | /// for loops, stl algorithms, etc. |
| 553 | /// for loops, STL algorithms, etc. |
553 | 554 | /// For example if g is a Graph and u is a Node, you can write: |
554 | 555 | ///\code |
555 | 556 | /// for(auto a: g.outArcs(u)) |
… |
… |
|
618 | 619 | /// incoming directed arcs of a certain node of the graph. It returns |
619 | 620 | /// a wrapped InArcIt, which looks like an STL container |
620 | 621 | /// (by having begin() and end()) which you can use in range-based |
621 | | /// for loops, stl algorithms, etc. |
| 622 | /// for loops, STL algorithms, etc. |
622 | 623 | /// For example if g is a Graph and u is a Node, you can write: |
623 | 624 | ///\code |
624 | 625 | /// for(auto a: g.inArcs(u)) |
diff --git a/lemon/concepts/path.h b/lemon/concepts/path.h
a
|
b
|
|
26 | 26 | |
27 | 27 | #include <lemon/core.h> |
28 | 28 | #include <lemon/concept_check.h> |
| 29 | #include <lemon/bits/stl_iterators.h> |
29 | 30 | |
30 | 31 | namespace lemon { |
31 | 32 | namespace concepts { |
… |
… |
|
121 | 122 | /// arcs of the path. It returns a wrapped |
122 | 123 | /// ArcIt, which looks like an STL container |
123 | 124 | /// (by having begin() and end()) which you can use in range-based |
124 | | /// for loops, stl algorithms, etc. |
| 125 | /// for loops, STL algorithms, etc. |
125 | 126 | /// For example you can write: |
126 | 127 | ///\code |
127 | 128 | /// for(auto a: p.arcs()) |
… |
… |
|
287 | 288 | /// arcs of the path. It returns a wrapped |
288 | 289 | /// ArcIt, which looks like an STL container |
289 | 290 | /// (by having begin() and end()) which you can use in range-based |
290 | | /// for loops, stl algorithms, etc. |
| 291 | /// for loops, STL algorithms, etc. |
291 | 292 | /// For example you can write: |
292 | 293 | ///\code |
293 | 294 | /// for(auto a: p.arcs()) |
… |
… |
|
334 | 335 | /// arcs of the path in reverse direction. It returns a wrapped |
335 | 336 | /// RevArcIt, which looks like an STL container |
336 | 337 | /// (by having begin() and end()) which you can use in range-based |
337 | | /// for loops, stl algorithms, etc. |
| 338 | /// for loops, STL algorithms, etc. |
338 | 339 | /// For example you can write: |
339 | 340 | ///\code |
340 | 341 | /// for(auto a: p.revArcs()) |
diff --git a/lemon/lp_base.h b/lemon/lp_base.h
a
|
b
|
|
191 | 191 | /// This function can be used for iterating on |
192 | 192 | /// the columns of the LP problem. It returns a wrapped ColIt, which looks |
193 | 193 | /// 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. |
195 | 195 | /// For example you can write: |
196 | 196 | ///\code |
197 | 197 | /// for(auto c: lp.cols()) |
… |
… |
|
301 | 301 | /// This function can be used for iterating on |
302 | 302 | /// the rows of the LP problem. It returns a wrapped RowIt, which looks |
303 | 303 | /// 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. |
305 | 305 | /// For example you can write: |
306 | 306 | ///\code |
307 | 307 | /// for(auto c: lp.rows()) |
diff --git a/lemon/maps.h b/lemon/maps.h
a
|
b
|
|
2585 | 2585 | /// \brief STL style iterator for the keys mapped to \c true. |
2586 | 2586 | /// |
2587 | 2587 | /// 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. |
2589 | 2589 | LemonRangeWrapper1<TrueIt, IterableBoolMap> |
2590 | 2590 | trueKeys() { |
2591 | 2591 | return LemonRangeWrapper1<TrueIt, IterableBoolMap>(*this); |
… |
… |
|
2634 | 2634 | /// \brief STL style iterator for the keys mapped to \c false. |
2635 | 2635 | /// |
2636 | 2636 | /// 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. |
2638 | 2638 | LemonRangeWrapper1<FalseIt, IterableBoolMap> |
2639 | 2639 | falseKeys() { |
2640 | 2640 | return LemonRangeWrapper1<FalseIt, IterableBoolMap>(*this); |
… |
… |
|
2688 | 2688 | /// \brief STL style iterator for the keys mapped to a given value. |
2689 | 2689 | /// |
2690 | 2690 | /// 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. |
2692 | 2692 | LemonRangeWrapper2<ItemIt, IterableBoolMap, bool> |
2693 | 2693 | items(bool value) { |
2694 | 2694 | return LemonRangeWrapper2<ItemIt, IterableBoolMap, bool>(*this, value); |
… |
… |
|
3038 | 3038 | /// \brief STL style iterator for the keys with the same value. |
3039 | 3039 | /// |
3040 | 3040 | /// 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. |
3042 | 3042 | LemonRangeWrapper2<ItemIt, IterableIntMap, int> |
3043 | 3043 | items(int value) { |
3044 | 3044 | return LemonRangeWrapper2<ItemIt, IterableIntMap, int>(*this, value); |
… |
… |
|
3291 | 3291 | /// \brief STL style iterator for the keys with the same value. |
3292 | 3292 | /// |
3293 | 3293 | /// 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. |
3295 | 3295 | LemonRangeWrapper2<ItemIt, IterableValueMap, V> |
3296 | 3296 | items(const V& value) { |
3297 | 3297 | return LemonRangeWrapper2<ItemIt, IterableValueMap, V>(*this, value); |
diff --git a/lemon/path.h b/lemon/path.h
a
|
b
|
|
30 | 30 | #include <lemon/error.h> |
31 | 31 | #include <lemon/core.h> |
32 | 32 | #include <lemon/concepts/path.h> |
| 33 | #include <lemon/bits/stl_iterators.h> |
33 | 34 | |
34 | 35 | namespace lemon { |
35 | 36 | |
… |
… |
|
146 | 147 | /// arcs of the path. It returns a wrapped |
147 | 148 | /// ArcIt, which looks like an STL container |
148 | 149 | /// (by having begin() and end()) which you can use in range-based |
149 | | /// for loops, stl algorithms, etc. |
| 150 | /// for loops, STL algorithms, etc. |
150 | 151 | /// For example you can write: |
151 | 152 | ///\code |
152 | 153 | /// for(auto a: p.arcs()) |
… |
… |
|
368 | 369 | /// arcs of the path. It returns a wrapped |
369 | 370 | /// ArcIt, which looks like an STL container |
370 | 371 | /// (by having begin() and end()) which you can use in range-based |
371 | | /// for loops, stl algorithms, etc. |
| 372 | /// for loops, STL algorithms, etc. |
372 | 373 | /// For example you can write: |
373 | 374 | ///\code |
374 | 375 | /// for(auto a: p.arcs()) |
… |
… |
|
583 | 584 | /// arcs of the path. It returns a wrapped |
584 | 585 | /// ArcIt, which looks like an STL container |
585 | 586 | /// (by having begin() and end()) which you can use in range-based |
586 | | /// for loops, stl algorithms, etc. |
| 587 | /// for loops, STL algorithms, etc. |
587 | 588 | /// For example you can write: |
588 | 589 | ///\code |
589 | 590 | /// for(auto a: p.arcs()) |
… |
… |
|
940 | 941 | /// arcs of the path. It returns a wrapped |
941 | 942 | /// ArcIt, which looks like an STL container |
942 | 943 | /// (by having begin() and end()) which you can use in range-based |
943 | | /// for loops, stl algorithms, etc. |
| 944 | /// for loops, STL algorithms, etc. |
944 | 945 | /// For example you can write: |
945 | 946 | ///\code |
946 | 947 | /// for(auto a: p.arcs()) |
… |
… |
|
1231 | 1232 | /// nodes of the path. It returns a wrapped |
1232 | 1233 | /// PathNodeIt, which looks like an STL container |
1233 | 1234 | /// (by having begin() and end()) which you can use in range-based |
1234 | | /// for loops, stl algorithms, etc. |
| 1235 | /// for loops, STL algorithms, etc. |
1235 | 1236 | /// For example you can write: |
1236 | 1237 | ///\code |
1237 | 1238 | /// for(auto u: pathNodes(g,p)) |