equal
deleted
inserted
replaced
24 #ifndef LEMON_CONCEPTS_PATH_H |
24 #ifndef LEMON_CONCEPTS_PATH_H |
25 #define LEMON_CONCEPTS_PATH_H |
25 #define LEMON_CONCEPTS_PATH_H |
26 |
26 |
27 #include <lemon/core.h> |
27 #include <lemon/core.h> |
28 #include <lemon/concept_check.h> |
28 #include <lemon/concept_check.h> |
|
29 #include <lemon/bits/stl_iterators.h> |
29 |
30 |
30 namespace lemon { |
31 namespace lemon { |
31 namespace concepts { |
32 namespace concepts { |
32 |
33 |
33 /// \addtogroup concept |
34 /// \addtogroup concept |
113 /// Comparison operator |
114 /// Comparison operator |
114 bool operator<(const ArcIt&) const {return false;} |
115 bool operator<(const ArcIt&) const {return false;} |
115 |
116 |
116 }; |
117 }; |
117 |
118 |
|
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 |
118 template <typename _Path> |
136 template <typename _Path> |
119 struct Constraints { |
137 struct Constraints { |
120 void constraints() { |
138 void constraints() { |
121 Path<Digraph> pc; |
139 Path<Digraph> pc; |
122 _Path p, pp(pc); |
140 _Path p, pp(pc); |
261 bool operator!=(const ArcIt&) const {return true;} |
279 bool operator!=(const ArcIt&) const {return true;} |
262 /// Comparison operator |
280 /// Comparison operator |
263 bool operator<(const ArcIt&) const {return false;} |
281 bool operator<(const ArcIt&) const {return false;} |
264 |
282 |
265 }; |
283 }; |
|
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 |
266 |
301 |
267 /// \brief LEMON style iterator for enumerating the arcs of a path |
302 /// \brief LEMON style iterator for enumerating the arcs of a path |
268 /// in reverse direction. |
303 /// in reverse direction. |
269 /// |
304 /// |
270 /// LEMON style iterator class for enumerating the arcs of a path |
305 /// LEMON style iterator class for enumerating the arcs of a path |
291 /// Comparison operator |
326 /// Comparison operator |
292 bool operator<(const RevArcIt&) const {return false;} |
327 bool operator<(const RevArcIt&) const {return false;} |
293 |
328 |
294 }; |
329 }; |
295 |
330 |
|
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 |
296 template <typename _Path> |
349 template <typename _Path> |
297 struct Constraints { |
350 struct Constraints { |
298 void constraints() { |
351 void constraints() { |
299 function_requires<_path_bits:: |
352 function_requires<_path_bits:: |
300 PathDumperConstraints<Digraph, _Path> >(); |
353 PathDumperConstraints<Digraph, _Path> >(); |