0
22
0
2
2
2
2
10
10
... | ... |
@@ -73,17 +73,17 @@ |
73 | 73 |
if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$ node potentials |
74 | 74 |
the following \e complementary \e slackness optimality conditions hold. |
75 | 75 |
|
76 | 76 |
- For all \f$uv\in A\f$ arcs: |
77 | 77 |
- if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$; |
78 | 78 |
- if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$; |
79 | 79 |
- if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. |
80 | 80 |
- For all \f$u\in V\f$ nodes: |
81 |
- \f$\pi(u) |
|
81 |
- \f$\pi(u)\leq 0\f$; |
|
82 | 82 |
- if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$, |
83 | 83 |
then \f$\pi(u)=0\f$. |
84 | 84 |
|
85 | 85 |
Here \f$cost^\pi(uv)\f$ denotes the \e reduced \e cost of the arc |
86 | 86 |
\f$uv\in A\f$ with respect to the potential function \f$\pi\f$, i.e. |
87 | 87 |
\f[ cost^\pi(uv) = cost(uv) + \pi(u) - \pi(v).\f] |
88 | 88 |
|
89 | 89 |
All algorithms provide dual solution (node potentials), as well, |
... | ... |
@@ -140,14 +140,14 @@ |
140 | 140 |
is optimal if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$ |
141 | 141 |
node potentials the following conditions hold. |
142 | 142 |
|
143 | 143 |
- For all \f$uv\in A\f$ arcs: |
144 | 144 |
- if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$; |
145 | 145 |
- if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$; |
146 | 146 |
- if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. |
147 | 147 |
- For all \f$u\in V\f$ nodes: |
148 |
- \f$\pi(u) |
|
148 |
- \f$\pi(u)\geq 0\f$; |
|
149 | 149 |
- if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$, |
150 | 150 |
then \f$\pi(u)=0\f$. |
151 | 151 |
|
152 | 152 |
*/ |
153 | 153 |
} |
... | ... |
@@ -295,17 +295,17 @@ |
295 | 295 |
typedef T OperationTraits; |
296 | 296 |
}; |
297 | 297 |
|
298 | 298 |
/// \brief \ref named-templ-param "Named parameter" for setting |
299 | 299 |
/// \c OperationTraits type. |
300 | 300 |
/// |
301 | 301 |
/// \ref named-templ-param "Named parameter" for setting |
302 | 302 |
/// \c OperationTraits type. |
303 |
/// For more information see \ref BellmanFordDefaultOperationTraits. |
|
303 |
/// For more information, see \ref BellmanFordDefaultOperationTraits. |
|
304 | 304 |
template <class T> |
305 | 305 |
struct SetOperationTraits |
306 | 306 |
: public BellmanFord< Digraph, LengthMap, SetOperationTraitsTraits<T> > { |
307 | 307 |
typedef BellmanFord< Digraph, LengthMap, SetOperationTraitsTraits<T> > |
308 | 308 |
Create; |
309 | 309 |
}; |
310 | 310 |
|
311 | 311 |
///@} |
... | ... |
@@ -713,32 +713,32 @@ |
713 | 713 |
/// the given node. |
714 | 714 |
/// |
715 | 715 |
/// This function returns the 'previous arc' of the shortest path |
716 | 716 |
/// tree for node \c v, i.e. it returns the last arc of a |
717 | 717 |
/// shortest path from a root to \c v. It is \c INVALID if \c v |
718 | 718 |
/// is not reached from the root(s) or if \c v is a root. |
719 | 719 |
/// |
720 | 720 |
/// The shortest path tree used here is equal to the shortest path |
721 |
/// tree used in \ref predNode() and \predMap(). |
|
721 |
/// tree used in \ref predNode() and \ref predMap(). |
|
722 | 722 |
/// |
723 | 723 |
/// \pre Either \ref run() or \ref init() must be called before |
724 | 724 |
/// using this function. |
725 | 725 |
Arc predArc(Node v) const { return (*_pred)[v]; } |
726 | 726 |
|
727 | 727 |
/// \brief Returns the 'previous node' of the shortest path tree for |
728 | 728 |
/// the given node. |
729 | 729 |
/// |
730 | 730 |
/// This function returns the 'previous node' of the shortest path |
731 | 731 |
/// tree for node \c v, i.e. it returns the last but one node of |
732 | 732 |
/// a shortest path from a root to \c v. It is \c INVALID if \c v |
733 | 733 |
/// is not reached from the root(s) or if \c v is a root. |
734 | 734 |
/// |
735 | 735 |
/// The shortest path tree used here is equal to the shortest path |
736 |
/// tree used in \ref predArc() and \predMap(). |
|
736 |
/// tree used in \ref predArc() and \ref predMap(). |
|
737 | 737 |
/// |
738 | 738 |
/// \pre Either \ref run() or \ref init() must be called before |
739 | 739 |
/// using this function. |
740 | 740 |
Node predNode(Node v) const { |
741 | 741 |
return (*_pred)[v] == INVALID ? INVALID : _gr->source((*_pred)[v]); |
742 | 742 |
} |
743 | 743 |
|
744 | 744 |
/// \brief Returns a const reference to the node map that stores the |
... | ... |
@@ -58,17 +58,17 @@ |
58 | 58 |
{ |
59 | 59 |
return new PredMap(g); |
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
///The type of the map that indicates which nodes are processed. |
63 | 63 |
|
64 | 64 |
///The type of the map that indicates which nodes are processed. |
65 | 65 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
66 |
///By default it is a NullMap. |
|
66 |
///By default, it is a NullMap. |
|
67 | 67 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
68 | 68 |
///Instantiates a \c ProcessedMap. |
69 | 69 |
|
70 | 70 |
///This function instantiates a \ref ProcessedMap. |
71 | 71 |
///\param g is the digraph, to which |
72 | 72 |
///we would like to define the \ref ProcessedMap |
73 | 73 |
#ifdef DOXYGEN |
74 | 74 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -843,17 +843,17 @@ |
843 | 843 |
{ |
844 | 844 |
return new PredMap(g); |
845 | 845 |
} |
846 | 846 |
|
847 | 847 |
///The type of the map that indicates which nodes are processed. |
848 | 848 |
|
849 | 849 |
///The type of the map that indicates which nodes are processed. |
850 | 850 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
851 |
///By default it is a NullMap. |
|
851 |
///By default, it is a NullMap. |
|
852 | 852 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
853 | 853 |
///Instantiates a ProcessedMap. |
854 | 854 |
|
855 | 855 |
///This function instantiates a ProcessedMap. |
856 | 856 |
///\param g is the digraph, to which |
857 | 857 |
///we would like to define the ProcessedMap. |
858 | 858 |
#ifdef DOXYGEN |
859 | 859 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -301,17 +301,17 @@ |
301 | 301 |
/// \brief \ref named-templ-param "Named parameter" for setting |
302 | 302 |
/// Elevator type with automatic allocation |
303 | 303 |
/// |
304 | 304 |
/// \ref named-templ-param "Named parameter" for setting Elevator |
305 | 305 |
/// type with automatic allocation. |
306 | 306 |
/// The Elevator should have standard constructor interface to be |
307 | 307 |
/// able to automatically created by the algorithm (i.e. the |
308 | 308 |
/// digraph and the maximum level should be passed to it). |
309 |
/// However an external elevator object could also be passed to the |
|
309 |
/// However, an external elevator object could also be passed to the |
|
310 | 310 |
/// algorithm with the \ref elevator(Elevator&) "elevator()" function |
311 | 311 |
/// before calling \ref run() or \ref init(). |
312 | 312 |
/// \sa SetElevator |
313 | 313 |
template <typename T> |
314 | 314 |
struct SetStandardElevator |
315 | 315 |
: public Circulation<Digraph, LowerMap, UpperMap, SupplyMap, |
316 | 316 |
SetStandardElevatorTraits<T> > { |
317 | 317 |
typedef Circulation<Digraph, LowerMap, UpperMap, SupplyMap, |
... | ... |
@@ -102,17 +102,17 @@ |
102 | 102 |
/// the nodes; this order has nothing to do with the iteration |
103 | 103 |
/// ordering of the nodes. |
104 | 104 |
bool operator<(Node) const { return false; } |
105 | 105 |
}; |
106 | 106 |
|
107 | 107 |
/// Iterator class for the nodes. |
108 | 108 |
|
109 | 109 |
/// This iterator goes through each node of the digraph. |
110 |
/// Its usage is quite simple, for example you can count the number |
|
110 |
/// Its usage is quite simple, for example, you can count the number |
|
111 | 111 |
/// of nodes in a digraph \c g of type \c %Digraph like this: |
112 | 112 |
///\code |
113 | 113 |
/// int count=0; |
114 | 114 |
/// for (Digraph::NodeIt n(g); n!=INVALID; ++n) ++count; |
115 | 115 |
///\endcode |
116 | 116 |
class NodeIt : public Node { |
117 | 117 |
public: |
118 | 118 |
/// Default constructor |
... | ... |
@@ -191,17 +191,17 @@ |
191 | 191 |
/// ordering of the arcs. |
192 | 192 |
bool operator<(Arc) const { return false; } |
193 | 193 |
}; |
194 | 194 |
|
195 | 195 |
/// Iterator class for the outgoing arcs of a node. |
196 | 196 |
|
197 | 197 |
/// This iterator goes trough the \e outgoing arcs of a certain node |
198 | 198 |
/// of a digraph. |
199 |
/// Its usage is quite simple, for example you can count the number |
|
199 |
/// Its usage is quite simple, for example, you can count the number |
|
200 | 200 |
/// of outgoing arcs of a node \c n |
201 | 201 |
/// in a digraph \c g of type \c %Digraph as follows. |
202 | 202 |
///\code |
203 | 203 |
/// int count=0; |
204 | 204 |
/// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count; |
205 | 205 |
///\endcode |
206 | 206 |
class OutArcIt : public Arc { |
207 | 207 |
public: |
... | ... |
@@ -236,17 +236,17 @@ |
236 | 236 |
/// outgoing arc of the corresponding node. |
237 | 237 |
OutArcIt& operator++() { return *this; } |
238 | 238 |
}; |
239 | 239 |
|
240 | 240 |
/// Iterator class for the incoming arcs of a node. |
241 | 241 |
|
242 | 242 |
/// This iterator goes trough the \e incoming arcs of a certain node |
243 | 243 |
/// of a digraph. |
244 |
/// Its usage is quite simple, for example you can count the number |
|
244 |
/// Its usage is quite simple, for example, you can count the number |
|
245 | 245 |
/// of incoming arcs of a node \c n |
246 | 246 |
/// in a digraph \c g of type \c %Digraph as follows. |
247 | 247 |
///\code |
248 | 248 |
/// int count=0; |
249 | 249 |
/// for(Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count; |
250 | 250 |
///\endcode |
251 | 251 |
class InArcIt : public Arc { |
252 | 252 |
public: |
... | ... |
@@ -280,17 +280,17 @@ |
280 | 280 |
/// Assign the iterator to the next |
281 | 281 |
/// incoming arc of the corresponding node. |
282 | 282 |
InArcIt& operator++() { return *this; } |
283 | 283 |
}; |
284 | 284 |
|
285 | 285 |
/// Iterator class for the arcs. |
286 | 286 |
|
287 | 287 |
/// This iterator goes through each arc of the digraph. |
288 |
/// Its usage is quite simple, for example you can count the number |
|
288 |
/// Its usage is quite simple, for example, you can count the number |
|
289 | 289 |
/// of arcs in a digraph \c g of type \c %Digraph as follows: |
290 | 290 |
///\code |
291 | 291 |
/// int count=0; |
292 | 292 |
/// for(Digraph::ArcIt a(g); a!=INVALID; ++a) ++count; |
293 | 293 |
///\endcode |
294 | 294 |
class ArcIt : public Arc { |
295 | 295 |
public: |
296 | 296 |
/// Default constructor |
... | ... |
@@ -135,17 +135,17 @@ |
135 | 135 |
/// ordering of the items. |
136 | 136 |
bool operator<(Node) const { return false; } |
137 | 137 |
|
138 | 138 |
}; |
139 | 139 |
|
140 | 140 |
/// Iterator class for the nodes. |
141 | 141 |
|
142 | 142 |
/// This iterator goes through each node of the graph. |
143 |
/// Its usage is quite simple, for example you can count the number |
|
143 |
/// Its usage is quite simple, for example, you can count the number |
|
144 | 144 |
/// of nodes in a graph \c g of type \c %Graph like this: |
145 | 145 |
///\code |
146 | 146 |
/// int count=0; |
147 | 147 |
/// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count; |
148 | 148 |
///\endcode |
149 | 149 |
class NodeIt : public Node { |
150 | 150 |
public: |
151 | 151 |
/// Default constructor |
... | ... |
@@ -223,17 +223,17 @@ |
223 | 223 |
/// the edges; this order has nothing to do with the iteration |
224 | 224 |
/// ordering of the edges. |
225 | 225 |
bool operator<(Edge) const { return false; } |
226 | 226 |
}; |
227 | 227 |
|
228 | 228 |
/// Iterator class for the edges. |
229 | 229 |
|
230 | 230 |
/// This iterator goes through each edge of the graph. |
231 |
/// Its usage is quite simple, for example you can count the number |
|
231 |
/// Its usage is quite simple, for example, you can count the number |
|
232 | 232 |
/// of edges in a graph \c g of type \c %Graph as follows: |
233 | 233 |
///\code |
234 | 234 |
/// int count=0; |
235 | 235 |
/// for(Graph::EdgeIt e(g); e!=INVALID; ++e) ++count; |
236 | 236 |
///\endcode |
237 | 237 |
class EdgeIt : public Edge { |
238 | 238 |
public: |
239 | 239 |
/// Default constructor |
... | ... |
@@ -267,17 +267,17 @@ |
267 | 267 |
/// |
268 | 268 |
EdgeIt& operator++() { return *this; } |
269 | 269 |
}; |
270 | 270 |
|
271 | 271 |
/// Iterator class for the incident edges of a node. |
272 | 272 |
|
273 | 273 |
/// This iterator goes trough the incident undirected edges |
274 | 274 |
/// of a certain node of a graph. |
275 |
/// Its usage is quite simple, for example you can compute the |
|
275 |
/// Its usage is quite simple, for example, you can compute the |
|
276 | 276 |
/// degree (i.e. the number of incident edges) of a node \c n |
277 | 277 |
/// in a graph \c g of type \c %Graph as follows. |
278 | 278 |
/// |
279 | 279 |
///\code |
280 | 280 |
/// int count=0; |
281 | 281 |
/// for(Graph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count; |
282 | 282 |
///\endcode |
283 | 283 |
/// |
... | ... |
@@ -364,17 +364,17 @@ |
364 | 364 |
/// Converison to \c Edge. |
365 | 365 |
/// |
366 | 366 |
operator Edge() const { return Edge(); } |
367 | 367 |
}; |
368 | 368 |
|
369 | 369 |
/// Iterator class for the arcs. |
370 | 370 |
|
371 | 371 |
/// This iterator goes through each directed arc of the graph. |
372 |
/// Its usage is quite simple, for example you can count the number |
|
372 |
/// Its usage is quite simple, for example, you can count the number |
|
373 | 373 |
/// of arcs in a graph \c g of type \c %Graph as follows: |
374 | 374 |
///\code |
375 | 375 |
/// int count=0; |
376 | 376 |
/// for(Graph::ArcIt a(g); a!=INVALID; ++a) ++count; |
377 | 377 |
///\endcode |
378 | 378 |
class ArcIt : public Arc { |
379 | 379 |
public: |
380 | 380 |
/// Default constructor |
... | ... |
@@ -408,17 +408,17 @@ |
408 | 408 |
/// |
409 | 409 |
ArcIt& operator++() { return *this; } |
410 | 410 |
}; |
411 | 411 |
|
412 | 412 |
/// Iterator class for the outgoing arcs of a node. |
413 | 413 |
|
414 | 414 |
/// This iterator goes trough the \e outgoing directed arcs of a |
415 | 415 |
/// certain node of a graph. |
416 |
/// Its usage is quite simple, for example you can count the number |
|
416 |
/// Its usage is quite simple, for example, you can count the number |
|
417 | 417 |
/// of outgoing arcs of a node \c n |
418 | 418 |
/// in a graph \c g of type \c %Graph as follows. |
419 | 419 |
///\code |
420 | 420 |
/// int count=0; |
421 | 421 |
/// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count; |
422 | 422 |
///\endcode |
423 | 423 |
class OutArcIt : public Arc { |
424 | 424 |
public: |
... | ... |
@@ -456,17 +456,17 @@ |
456 | 456 |
/// outgoing arc of the corresponding node. |
457 | 457 |
OutArcIt& operator++() { return *this; } |
458 | 458 |
}; |
459 | 459 |
|
460 | 460 |
/// Iterator class for the incoming arcs of a node. |
461 | 461 |
|
462 | 462 |
/// This iterator goes trough the \e incoming directed arcs of a |
463 | 463 |
/// certain node of a graph. |
464 |
/// Its usage is quite simple, for example you can count the number |
|
464 |
/// Its usage is quite simple, for example, you can count the number |
|
465 | 465 |
/// of incoming arcs of a node \c n |
466 | 466 |
/// in a graph \c g of type \c %Graph as follows. |
467 | 467 |
///\code |
468 | 468 |
/// int count=0; |
469 | 469 |
/// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count; |
470 | 470 |
///\endcode |
471 | 471 |
class InArcIt : public Arc { |
472 | 472 |
public: |
... | ... |
@@ -582,30 +582,30 @@ |
582 | 582 |
return *this; |
583 | 583 |
} |
584 | 584 |
}; |
585 | 585 |
|
586 | 586 |
/// \brief The first node of the edge. |
587 | 587 |
/// |
588 | 588 |
/// Returns the first node of the given edge. |
589 | 589 |
/// |
590 |
/// Edges don't have source and target nodes, however methods |
|
590 |
/// Edges don't have source and target nodes, however, methods |
|
591 | 591 |
/// u() and v() are used to query the two end-nodes of an edge. |
592 | 592 |
/// The orientation of an edge that arises this way is called |
593 | 593 |
/// the inherent direction, it is used to define the default |
594 | 594 |
/// direction for the corresponding arcs. |
595 | 595 |
/// \sa v() |
596 | 596 |
/// \sa direction() |
597 | 597 |
Node u(Edge) const { return INVALID; } |
598 | 598 |
|
599 | 599 |
/// \brief The second node of the edge. |
600 | 600 |
/// |
601 | 601 |
/// Returns the second node of the given edge. |
602 | 602 |
/// |
603 |
/// Edges don't have source and target nodes, however methods |
|
603 |
/// Edges don't have source and target nodes, however, methods |
|
604 | 604 |
/// u() and v() are used to query the two end-nodes of an edge. |
605 | 605 |
/// The orientation of an edge that arises this way is called |
606 | 606 |
/// the inherent direction, it is used to define the default |
607 | 607 |
/// direction for the corresponding arcs. |
608 | 608 |
/// \sa u() |
609 | 609 |
/// \sa direction() |
610 | 610 |
Node v(Edge) const { return INVALID; } |
611 | 611 |
... | ... |
@@ -13,17 +13,17 @@ |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
///\ingroup graph_concepts |
20 | 20 |
///\file |
21 |
///\brief The |
|
21 |
///\brief The concepts of graph components. |
|
22 | 22 |
|
23 | 23 |
#ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H |
24 | 24 |
#define LEMON_CONCEPTS_GRAPH_COMPONENTS_H |
25 | 25 |
|
26 | 26 |
#include <lemon/core.h> |
27 | 27 |
#include <lemon/concepts/maps.h> |
28 | 28 |
|
29 | 29 |
#include <lemon/bits/alteration_notifier.h> |
... | ... |
@@ -13,17 +13,17 @@ |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
///\ingroup concept |
20 | 20 |
///\file |
21 |
///\brief |
|
21 |
///\brief The concept of paths |
|
22 | 22 |
/// |
23 | 23 |
|
24 | 24 |
#ifndef LEMON_CONCEPTS_PATH_H |
25 | 25 |
#define LEMON_CONCEPTS_PATH_H |
26 | 26 |
|
27 | 27 |
#include <lemon/core.h> |
28 | 28 |
#include <lemon/concept_check.h> |
29 | 29 |
|
... | ... |
@@ -33,70 +33,79 @@ |
33 | 33 |
/// \addtogroup concept |
34 | 34 |
/// @{ |
35 | 35 |
|
36 | 36 |
/// \brief A skeleton structure for representing directed paths in |
37 | 37 |
/// a digraph. |
38 | 38 |
/// |
39 | 39 |
/// A skeleton structure for representing directed paths in a |
40 | 40 |
/// digraph. |
41 |
/// In a sense, a path can be treated as a list of arcs. |
|
42 |
/// LEMON path types just store this list. As a consequence, they cannot |
|
43 |
/// enumerate the nodes on the path directly and a zero length path |
|
44 |
/// cannot store its source node. |
|
45 |
/// |
|
46 |
/// The arcs of a path should be stored in the order of their directions, |
|
47 |
/// i.e. the target node of each arc should be the same as the source |
|
48 |
/// node of the next arc. This consistency could be checked using |
|
49 |
/// \ref checkPath(). |
|
50 |
/// The source and target nodes of a (consistent) path can be obtained |
|
51 |
/// using \ref pathSource() and \ref pathTarget(). |
|
52 |
/// |
|
53 |
/// A path can be constructed from another path of any type using the |
|
54 |
/// copy constructor or the assignment operator. |
|
55 |
/// |
|
41 | 56 |
/// \tparam GR The digraph type in which the path is. |
42 |
/// |
|
43 |
/// In a sense, the path can be treated as a list of arcs. The |
|
44 |
/// lemon path type stores just this list. As a consequence it |
|
45 |
/// cannot enumerate the nodes in the path and the zero length |
|
46 |
/// paths cannot store the source. |
|
47 |
/// |
|
48 | 57 |
template <typename GR> |
49 | 58 |
class Path { |
50 | 59 |
public: |
51 | 60 |
|
52 | 61 |
/// Type of the underlying digraph. |
53 | 62 |
typedef GR Digraph; |
54 | 63 |
/// Arc type of the underlying digraph. |
55 | 64 |
typedef typename Digraph::Arc Arc; |
56 | 65 |
|
57 | 66 |
class ArcIt; |
58 | 67 |
|
59 | 68 |
/// \brief Default constructor |
60 | 69 |
Path() {} |
61 | 70 |
|
62 |
/// \brief Template constructor |
|
71 |
/// \brief Template copy constructor |
|
63 | 72 |
template <typename CPath> |
64 | 73 |
Path(const CPath& cpath) {} |
65 | 74 |
|
66 |
/// \brief Template assigment |
|
75 |
/// \brief Template assigment operator |
|
67 | 76 |
template <typename CPath> |
68 | 77 |
Path& operator=(const CPath& cpath) { |
69 | 78 |
ignore_unused_variable_warning(cpath); |
70 | 79 |
return *this; |
71 | 80 |
} |
72 | 81 |
|
73 |
/// Length of the path |
|
82 |
/// Length of the path, i.e. the number of arcs on the path. |
|
74 | 83 |
int length() const { return 0;} |
75 | 84 |
|
76 | 85 |
/// Returns whether the path is empty. |
77 | 86 |
bool empty() const { return true;} |
78 | 87 |
|
79 | 88 |
/// Resets the path to an empty path. |
80 | 89 |
void clear() {} |
81 | 90 |
|
82 |
/// \brief LEMON style iterator for |
|
91 |
/// \brief LEMON style iterator for enumerating the arcs of a path. |
|
83 | 92 |
/// |
84 |
/// |
|
93 |
/// LEMON style iterator class for enumerating the arcs of a path. |
|
85 | 94 |
class ArcIt { |
86 | 95 |
public: |
87 | 96 |
/// Default constructor |
88 | 97 |
ArcIt() {} |
89 | 98 |
/// Invalid constructor |
90 | 99 |
ArcIt(Invalid) {} |
91 |
/// |
|
100 |
/// Sets the iterator to the first arc of the given path |
|
92 | 101 |
ArcIt(const Path &) {} |
93 | 102 |
|
94 |
/// Conversion to Arc |
|
103 |
/// Conversion to \c Arc |
|
95 | 104 |
operator Arc() const { return INVALID; } |
96 | 105 |
|
97 | 106 |
/// Next arc |
98 | 107 |
ArcIt& operator++() {return *this;} |
99 | 108 |
|
100 | 109 |
/// Comparison operator |
101 | 110 |
bool operator==(const ArcIt&) const {return true;} |
102 | 111 |
/// Comparison operator |
... | ... |
@@ -187,98 +196,92 @@ |
187 | 196 |
}; |
188 | 197 |
|
189 | 198 |
} |
190 | 199 |
|
191 | 200 |
|
192 | 201 |
/// \brief A skeleton structure for path dumpers. |
193 | 202 |
/// |
194 | 203 |
/// A skeleton structure for path dumpers. The path dumpers are |
195 |
/// the generalization of the paths. The path dumpers can |
|
196 |
/// enumerate the arcs of the path wheter in forward or in |
|
197 |
/// backward order. In most time these classes are not used |
|
198 |
/// directly rather it used to assign a dumped class to a real |
|
199 |
/// |
|
204 |
/// the generalization of the paths, they can enumerate the arcs |
|
205 |
/// of the path either in forward or in backward order. |
|
206 |
/// These classes are typically not used directly, they are rather |
|
207 |
/// used to be assigned to a real path type. |
|
200 | 208 |
/// |
201 | 209 |
/// The main purpose of this concept is that the shortest path |
202 |
/// algorithms can enumerate easily the arcs in reverse order. |
|
203 |
/// If we would like to give back a real path from these |
|
204 |
/// algorithms then we should create a temporarly path object. In |
|
205 |
/// LEMON such algorithms gives back a path dumper what can |
|
206 |
/// |
|
210 |
/// algorithms can enumerate the arcs easily in reverse order. |
|
211 |
/// In LEMON, such algorithms give back a (reverse) path dumper that |
|
212 |
/// can be assigned to a real path. The dumpers can be implemented as |
|
207 | 213 |
/// an adaptor class to the predecessor map. |
208 | 214 |
/// |
209 | 215 |
/// \tparam GR The digraph type in which the path is. |
210 |
/// |
|
211 |
/// The paths can be constructed from any path type by a |
|
212 |
/// template constructor or a template assignment operator. |
|
213 | 216 |
template <typename GR> |
214 | 217 |
class PathDumper { |
215 | 218 |
public: |
216 | 219 |
|
217 | 220 |
/// Type of the underlying digraph. |
218 | 221 |
typedef GR Digraph; |
219 | 222 |
/// Arc type of the underlying digraph. |
220 | 223 |
typedef typename Digraph::Arc Arc; |
221 | 224 |
|
222 |
/// Length of the path |
|
225 |
/// Length of the path, i.e. the number of arcs on the path. |
|
223 | 226 |
int length() const { return 0;} |
224 | 227 |
|
225 | 228 |
/// Returns whether the path is empty. |
226 | 229 |
bool empty() const { return true;} |
227 | 230 |
|
228 | 231 |
/// \brief Forward or reverse dumping |
229 | 232 |
/// |
230 |
/// If the RevPathTag is defined and true then reverse dumping |
|
231 |
/// is provided in the path dumper. In this case instead of the |
|
232 |
/// ArcIt the RevArcIt iterator should be implemented in the |
|
233 |
/// dumper. |
|
233 |
/// If this tag is defined to be \c True, then reverse dumping |
|
234 |
/// is provided in the path dumper. In this case, \c RevArcIt |
|
235 |
/// iterator should be implemented instead of \c ArcIt iterator. |
|
234 | 236 |
typedef False RevPathTag; |
235 | 237 |
|
236 |
/// \brief LEMON style iterator for |
|
238 |
/// \brief LEMON style iterator for enumerating the arcs of a path. |
|
237 | 239 |
/// |
238 |
/// |
|
240 |
/// LEMON style iterator class for enumerating the arcs of a path. |
|
239 | 241 |
class ArcIt { |
240 | 242 |
public: |
241 | 243 |
/// Default constructor |
242 | 244 |
ArcIt() {} |
243 | 245 |
/// Invalid constructor |
244 | 246 |
ArcIt(Invalid) {} |
245 |
/// |
|
247 |
/// Sets the iterator to the first arc of the given path |
|
246 | 248 |
ArcIt(const PathDumper&) {} |
247 | 249 |
|
248 |
/// Conversion to Arc |
|
250 |
/// Conversion to \c Arc |
|
249 | 251 |
operator Arc() const { return INVALID; } |
250 | 252 |
|
251 | 253 |
/// Next arc |
252 | 254 |
ArcIt& operator++() {return *this;} |
253 | 255 |
|
254 | 256 |
/// Comparison operator |
255 | 257 |
bool operator==(const ArcIt&) const {return true;} |
256 | 258 |
/// Comparison operator |
257 | 259 |
bool operator!=(const ArcIt&) const {return true;} |
258 | 260 |
/// Comparison operator |
259 | 261 |
bool operator<(const ArcIt&) const {return false;} |
260 | 262 |
|
261 | 263 |
}; |
262 | 264 |
|
263 |
/// \brief LEMON style iterator for |
|
265 |
/// \brief LEMON style iterator for enumerating the arcs of a path |
|
266 |
/// in reverse direction. |
|
264 | 267 |
/// |
265 |
/// This class is used to iterate on the arcs of the paths in |
|
266 |
/// reverse direction. |
|
268 |
/// LEMON style iterator class for enumerating the arcs of a path |
|
269 |
/// in reverse direction. |
|
267 | 270 |
class RevArcIt { |
268 | 271 |
public: |
269 | 272 |
/// Default constructor |
270 | 273 |
RevArcIt() {} |
271 | 274 |
/// Invalid constructor |
272 | 275 |
RevArcIt(Invalid) {} |
273 |
/// |
|
276 |
/// Sets the iterator to the last arc of the given path |
|
274 | 277 |
RevArcIt(const PathDumper &) {} |
275 | 278 |
|
276 |
/// Conversion to Arc |
|
279 |
/// Conversion to \c Arc |
|
277 | 280 |
operator Arc() const { return INVALID; } |
278 | 281 |
|
279 | 282 |
/// Next arc |
280 | 283 |
RevArcIt& operator++() {return *this;} |
281 | 284 |
|
282 | 285 |
/// Comparison operator |
283 | 286 |
bool operator==(const RevArcIt&) const {return true;} |
284 | 287 |
/// Comparison operator |
... | ... |
@@ -207,17 +207,17 @@ |
207 | 207 |
/// "NoSubCounter"s along with the main counter. |
208 | 208 |
void reset(int c=0) {count=c;} |
209 | 209 |
/// Returns the value of the counter. |
210 | 210 |
operator int() {return count;} |
211 | 211 |
}; |
212 | 212 |
|
213 | 213 |
/// 'Do nothing' version of Counter. |
214 | 214 |
|
215 |
/// This class can be used in the same way as \ref Counter |
|
215 |
/// This class can be used in the same way as \ref Counter, but it |
|
216 | 216 |
/// does not count at all and does not print report on destruction. |
217 | 217 |
/// |
218 | 218 |
/// Replacing a \ref Counter with a \ref NoCounter makes it possible |
219 | 219 |
/// to turn off all counting and reporting (SubCounters should also |
220 | 220 |
/// be replaced with NoSubCounters), so it does not affect the |
221 | 221 |
/// efficiency of the program at all. |
222 | 222 |
/// |
223 | 223 |
/// \sa Counter |
... | ... |
@@ -58,17 +58,17 @@ |
58 | 58 |
{ |
59 | 59 |
return new PredMap(g); |
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
///The type of the map that indicates which nodes are processed. |
63 | 63 |
|
64 | 64 |
///The type of the map that indicates which nodes are processed. |
65 | 65 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
66 |
///By default it is a NullMap. |
|
66 |
///By default, it is a NullMap. |
|
67 | 67 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
68 | 68 |
///Instantiates a \c ProcessedMap. |
69 | 69 |
|
70 | 70 |
///This function instantiates a \ref ProcessedMap. |
71 | 71 |
///\param g is the digraph, to which |
72 | 72 |
///we would like to define the \ref ProcessedMap. |
73 | 73 |
#ifdef DOXYGEN |
74 | 74 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -773,17 +773,17 @@ |
773 | 773 |
{ |
774 | 774 |
return new PredMap(g); |
775 | 775 |
} |
776 | 776 |
|
777 | 777 |
///The type of the map that indicates which nodes are processed. |
778 | 778 |
|
779 | 779 |
///The type of the map that indicates which nodes are processed. |
780 | 780 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
781 |
///By default it is a NullMap. |
|
781 |
///By default, it is a NullMap. |
|
782 | 782 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
783 | 783 |
///Instantiates a ProcessedMap. |
784 | 784 |
|
785 | 785 |
///This function instantiates a ProcessedMap. |
786 | 786 |
///\param g is the digraph, to which |
787 | 787 |
///we would like to define the ProcessedMap. |
788 | 788 |
#ifdef DOXYGEN |
789 | 789 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -127,17 +127,17 @@ |
127 | 127 |
{ |
128 | 128 |
return new PredMap(g); |
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
///The type of the map that indicates which nodes are processed. |
132 | 132 |
|
133 | 133 |
///The type of the map that indicates which nodes are processed. |
134 | 134 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
135 |
///By default it is a NullMap. |
|
135 |
///By default, it is a NullMap. |
|
136 | 136 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
137 | 137 |
///Instantiates a \c ProcessedMap. |
138 | 138 |
|
139 | 139 |
///This function instantiates a \ref ProcessedMap. |
140 | 140 |
///\param g is the digraph, to which |
141 | 141 |
///we would like to define the \ref ProcessedMap. |
142 | 142 |
#ifdef DOXYGEN |
143 | 143 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -421,17 +421,17 @@ |
421 | 421 |
///heap and cross reference types with automatic allocation |
422 | 422 |
/// |
423 | 423 |
///\ref named-templ-param "Named parameter" for setting heap and cross |
424 | 424 |
///reference types with automatic allocation. |
425 | 425 |
///They should have standard constructor interfaces to be able to |
426 | 426 |
///automatically created by the algorithm (i.e. the digraph should be |
427 | 427 |
///passed to the constructor of the cross reference and the cross |
428 | 428 |
///reference should be passed to the constructor of the heap). |
429 |
///However external heap and cross reference objects could also be |
|
429 |
///However, external heap and cross reference objects could also be |
|
430 | 430 |
///passed to the algorithm using the \ref heap() function before |
431 | 431 |
///calling \ref run(Node) "run()" or \ref init(). |
432 | 432 |
///\sa SetHeap |
433 | 433 |
template <class H, class CR = typename Digraph::template NodeMap<int> > |
434 | 434 |
struct SetStandardHeap |
435 | 435 |
: public Dijkstra< Digraph, LengthMap, SetStandardHeapTraits<H, CR> > { |
436 | 436 |
typedef Dijkstra< Digraph, LengthMap, SetStandardHeapTraits<H, CR> > |
437 | 437 |
Create; |
... | ... |
@@ -442,17 +442,17 @@ |
442 | 442 |
typedef T OperationTraits; |
443 | 443 |
}; |
444 | 444 |
|
445 | 445 |
/// \brief \ref named-templ-param "Named parameter" for setting |
446 | 446 |
///\c OperationTraits type |
447 | 447 |
/// |
448 | 448 |
///\ref named-templ-param "Named parameter" for setting |
449 | 449 |
///\c OperationTraits type. |
450 |
/// For more information see \ref DijkstraDefaultOperationTraits. |
|
450 |
/// For more information, see \ref DijkstraDefaultOperationTraits. |
|
451 | 451 |
template <class T> |
452 | 452 |
struct SetOperationTraits |
453 | 453 |
: public Dijkstra<Digraph, LengthMap, SetOperationTraitsTraits<T> > { |
454 | 454 |
typedef Dijkstra<Digraph, LengthMap, SetOperationTraitsTraits<T> > |
455 | 455 |
Create; |
456 | 456 |
}; |
457 | 457 |
|
458 | 458 |
///@} |
... | ... |
@@ -991,17 +991,17 @@ |
991 | 991 |
{ |
992 | 992 |
return new PredMap(g); |
993 | 993 |
} |
994 | 994 |
|
995 | 995 |
///The type of the map that indicates which nodes are processed. |
996 | 996 |
|
997 | 997 |
///The type of the map that indicates which nodes are processed. |
998 | 998 |
///It must conform to the \ref concepts::WriteMap "WriteMap" concept. |
999 |
///By default it is a NullMap. |
|
999 |
///By default, it is a NullMap. |
|
1000 | 1000 |
typedef NullMap<typename Digraph::Node,bool> ProcessedMap; |
1001 | 1001 |
///Instantiates a ProcessedMap. |
1002 | 1002 |
|
1003 | 1003 |
///This function instantiates a ProcessedMap. |
1004 | 1004 |
///\param g is the digraph, to which |
1005 | 1005 |
///we would like to define the ProcessedMap. |
1006 | 1006 |
#ifdef DOXYGEN |
1007 | 1007 |
static ProcessedMap *createProcessedMap(const Digraph &g) |
... | ... |
@@ -289,21 +289,19 @@ |
289 | 289 |
/// \param cutMap The cut will be returned in this map. |
290 | 290 |
/// It must be a \c bool (or convertible) \ref concepts::ReadWriteMap |
291 | 291 |
/// "ReadWriteMap" on the graph nodes. |
292 | 292 |
/// |
293 | 293 |
/// \return The value of the minimum cut between \c s and \c t. |
294 | 294 |
/// |
295 | 295 |
/// \pre \ref run() must be called before using this function. |
296 | 296 |
template <typename CutMap> |
297 |
Value minCutMap(const Node& s, |
|
297 |
Value minCutMap(const Node& s, |
|
298 | 298 |
const Node& t, |
299 |
///< |
|
300 | 299 |
CutMap& cutMap |
301 |
///< |
|
302 | 300 |
) const { |
303 | 301 |
Node sn = s, tn = t; |
304 | 302 |
bool s_root=false; |
305 | 303 |
Node rn = INVALID; |
306 | 304 |
Value value = std::numeric_limits<Value>::max(); |
307 | 305 |
|
308 | 306 |
while (sn != tn) { |
309 | 307 |
if ((*_order)[sn] < (*_order)[tn]) { |
... | ... |
@@ -389,17 +387,17 @@ |
389 | 387 |
/// \code |
390 | 388 |
/// MinCutNodeIt(gomory, s, t, true); |
391 | 389 |
/// \endcode |
392 | 390 |
/// and |
393 | 391 |
/// \code |
394 | 392 |
/// MinCutNodeIt(gomory, t, s, false); |
395 | 393 |
/// \endcode |
396 | 394 |
/// does not necessarily give the same set of nodes. |
397 |
/// However it is ensured that |
|
395 |
/// However, it is ensured that |
|
398 | 396 |
/// \code |
399 | 397 |
/// MinCutNodeIt(gomory, s, t, true); |
400 | 398 |
/// \endcode |
401 | 399 |
/// and |
402 | 400 |
/// \code |
403 | 401 |
/// MinCutNodeIt(gomory, s, t, false); |
404 | 402 |
/// \endcode |
405 | 403 |
/// together list each node exactly once. |
... | ... |
@@ -137,17 +137,17 @@ |
137 | 137 |
bool _negY; |
138 | 138 |
|
139 | 139 |
bool _preScale; |
140 | 140 |
///Constructor |
141 | 141 |
|
142 | 142 |
///Constructor |
143 | 143 |
///\param gr Reference to the graph to be printed. |
144 | 144 |
///\param ost Reference to the output stream. |
145 |
///By default it is <tt>std::cout</tt>. |
|
145 |
///By default, it is <tt>std::cout</tt>. |
|
146 | 146 |
///\param pros If it is \c true, then the \c ostream referenced by \c os |
147 | 147 |
///will be explicitly deallocated by the destructor. |
148 | 148 |
DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout, |
149 | 149 |
bool pros = false) : |
150 | 150 |
g(gr), os(ost), |
151 | 151 |
_coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0), |
152 | 152 |
_nodeColors(WHITE), _arcColors(BLACK), |
153 | 153 |
_arcWidths(1.0), _arcWidthScale(0.003), |
... | ... |
@@ -507,17 +507,17 @@ |
507 | 507 |
|
508 | 508 |
///Negates the Y coordinates. |
509 | 509 |
GraphToEps<T> &negateY(bool b=true) { |
510 | 510 |
_negY=b;return *this; |
511 | 511 |
} |
512 | 512 |
|
513 | 513 |
///Turn on/off pre-scaling |
514 | 514 |
|
515 |
///By default graphToEps() rescales the whole image in order to avoid |
|
515 |
///By default, graphToEps() rescales the whole image in order to avoid |
|
516 | 516 |
///very big or very small bounding boxes. |
517 | 517 |
/// |
518 | 518 |
///This (p)rescaling can be turned off with this function. |
519 | 519 |
/// |
520 | 520 |
GraphToEps<T> &preScale(bool b=true) { |
521 | 521 |
_preScale=b;return *this; |
522 | 522 |
} |
523 | 523 |
|
... | ... |
@@ -1109,29 +1109,29 @@ |
1109 | 1109 |
|
1110 | 1110 |
|
1111 | 1111 |
///Generates an EPS file from a graph |
1112 | 1112 |
|
1113 | 1113 |
///\ingroup eps_io |
1114 | 1114 |
///Generates an EPS file from a graph. |
1115 | 1115 |
///\param g Reference to the graph to be printed. |
1116 | 1116 |
///\param os Reference to the output stream. |
1117 |
///By default it is <tt>std::cout</tt>. |
|
1117 |
///By default, it is <tt>std::cout</tt>. |
|
1118 | 1118 |
/// |
1119 | 1119 |
///This function also has a lot of |
1120 | 1120 |
///\ref named-templ-func-param "named parameters", |
1121 | 1121 |
///they are declared as the members of class \ref GraphToEps. The following |
1122 | 1122 |
///example shows how to use these parameters. |
1123 | 1123 |
///\code |
1124 | 1124 |
/// graphToEps(g,os).scale(10).coords(coords) |
1125 | 1125 |
/// .nodeScale(2).nodeSizes(sizes) |
1126 | 1126 |
/// .arcWidthScale(.4).run(); |
1127 | 1127 |
///\endcode |
1128 | 1128 |
/// |
1129 |
///For more detailed examples see the \ref graph_to_eps_demo.cc demo file. |
|
1129 |
///For more detailed examples, see the \ref graph_to_eps_demo.cc demo file. |
|
1130 | 1130 |
/// |
1131 | 1131 |
///\warning Don't forget to put the \ref GraphToEps::run() "run()" |
1132 | 1132 |
///to the end of the parameter list. |
1133 | 1133 |
///\sa GraphToEps |
1134 | 1134 |
///\sa graphToEps(GR &g, const char *file_name) |
1135 | 1135 |
template<class GR> |
1136 | 1136 |
GraphToEps<DefaultGraphToEpsTraits<GR> > |
1137 | 1137 |
graphToEps(GR &g, std::ostream& os=std::cout) |
... | ... |
@@ -282,17 +282,17 @@ |
282 | 282 |
/// |
283 | 283 |
/// \brief Hypercube graph class |
284 | 284 |
/// |
285 | 285 |
/// HypercubeGraph implements a special graph type. The nodes of the |
286 | 286 |
/// graph are indexed with integers having at most \c dim binary digits. |
287 | 287 |
/// Two nodes are connected in the graph if and only if their indices |
288 | 288 |
/// differ only on one position in the binary form. |
289 | 289 |
/// This class is completely static and it needs constant memory space. |
290 |
/// Thus you can neither add nor delete nodes or edges, however |
|
290 |
/// Thus you can neither add nor delete nodes or edges, however, |
|
291 | 291 |
/// the structure can be resized using resize(). |
292 | 292 |
/// |
293 | 293 |
/// This type fully conforms to the \ref concepts::Graph "Graph concept". |
294 | 294 |
/// Most of its member functions and nested classes are documented |
295 | 295 |
/// only in the concept class. |
296 | 296 |
/// |
297 | 297 |
/// This class provides constant time counting for nodes, edges and arcs. |
298 | 298 |
/// |
... | ... |
@@ -422,17 +422,17 @@ |
422 | 422 |
/// nodeMap("coordinates", coord_map). |
423 | 423 |
/// arcMap("capacity", cap_map). |
424 | 424 |
/// node("source", src). |
425 | 425 |
/// node("target", trg). |
426 | 426 |
/// attribute("caption", caption). |
427 | 427 |
/// run(); |
428 | 428 |
///\endcode |
429 | 429 |
/// |
430 |
/// By default the reader uses the first section in the file of the |
|
430 |
/// By default, the reader uses the first section in the file of the |
|
431 | 431 |
/// proper type. If a section has an optional name, then it can be |
432 | 432 |
/// selected for reading by giving an optional name parameter to the |
433 | 433 |
/// \c nodes(), \c arcs() or \c attributes() functions. |
434 | 434 |
/// |
435 | 435 |
/// The \c useNodes() and \c useArcs() functions are used to tell the reader |
436 | 436 |
/// that the nodes or arcs should not be constructed (added to the |
437 | 437 |
/// graph) during the reading, but instead the label map of the items |
438 | 438 |
/// are given as a parameter of these functions. An |
... | ... |
@@ -2216,17 +2216,17 @@ |
2216 | 2216 |
/// |
2217 | 2217 |
/// The first parameter is the type descriptor of the section, the |
2218 | 2218 |
/// second is a functor, which takes just one \c std::string |
2219 | 2219 |
/// parameter. At the reading process, each line of the section |
2220 | 2220 |
/// will be given to the functor object. However, the empty lines |
2221 | 2221 |
/// and the comment lines are filtered out, and the leading |
2222 | 2222 |
/// whitespaces are trimmed from each processed string. |
2223 | 2223 |
/// |
2224 |
/// For example let's see a section, which contain several |
|
2224 |
/// For example, let's see a section, which contain several |
|
2225 | 2225 |
/// integers, which should be inserted into a vector. |
2226 | 2226 |
///\code |
2227 | 2227 |
/// @numbers |
2228 | 2228 |
/// 12 45 23 |
2229 | 2229 |
/// 4 |
2230 | 2230 |
/// 23 6 |
2231 | 2231 |
///\endcode |
2232 | 2232 |
/// |
... | ... |
@@ -395,29 +395,29 @@ |
395 | 395 |
/// added to the digraph. |
396 | 396 |
bool valid(Arc a) const { return Parent::valid(a); } |
397 | 397 |
|
398 | 398 |
/// Change the target node of an arc |
399 | 399 |
|
400 | 400 |
/// This function changes the target node of the given arc \c a to \c n. |
401 | 401 |
/// |
402 | 402 |
///\note \c ArcIt and \c OutArcIt iterators referencing the changed |
403 |
///arc remain valid, |
|
403 |
///arc remain valid, but \c InArcIt iterators are invalidated. |
|
404 | 404 |
/// |
405 | 405 |
///\warning This functionality cannot be used together with the Snapshot |
406 | 406 |
///feature. |
407 | 407 |
void changeTarget(Arc a, Node n) { |
408 | 408 |
Parent::changeTarget(a,n); |
409 | 409 |
} |
410 | 410 |
/// Change the source node of an arc |
411 | 411 |
|
412 | 412 |
/// This function changes the source node of the given arc \c a to \c n. |
413 | 413 |
/// |
414 | 414 |
///\note \c InArcIt iterators referencing the changed arc remain |
415 |
///valid, |
|
415 |
///valid, but \c ArcIt and \c OutArcIt iterators are invalidated. |
|
416 | 416 |
/// |
417 | 417 |
///\warning This functionality cannot be used together with the Snapshot |
418 | 418 |
///feature. |
419 | 419 |
void changeSource(Arc a, Node n) { |
420 | 420 |
Parent::changeSource(a,n); |
421 | 421 |
} |
422 | 422 |
|
423 | 423 |
/// Reverse the direction of an arc. |
... | ... |
@@ -554,17 +554,17 @@ |
554 | 554 |
/// |
555 | 555 |
/// \note After a state is restored, you cannot restore a later state, |
556 | 556 |
/// i.e. you cannot add the removed nodes and arcs again using |
557 | 557 |
/// another Snapshot instance. |
558 | 558 |
/// |
559 | 559 |
/// \warning Node and arc deletions and other modifications (e.g. |
560 | 560 |
/// reversing, contracting, splitting arcs or nodes) cannot be |
561 | 561 |
/// restored. These events invalidate the snapshot. |
562 |
/// However the arcs and nodes that were added to the digraph after |
|
562 |
/// However, the arcs and nodes that were added to the digraph after |
|
563 | 563 |
/// making the current snapshot can be removed without invalidating it. |
564 | 564 |
class Snapshot { |
565 | 565 |
protected: |
566 | 566 |
|
567 | 567 |
typedef Parent::NodeNotifier NodeNotifier; |
568 | 568 |
|
569 | 569 |
class NodeObserverProxy : public NodeNotifier::ObserverBase { |
570 | 570 |
public: |
... | ... |
@@ -1281,17 +1281,17 @@ |
1281 | 1281 |
void changeU(Edge e, Node n) { |
1282 | 1282 |
Parent::changeU(e,n); |
1283 | 1283 |
} |
1284 | 1284 |
/// \brief Change the second node of an edge. |
1285 | 1285 |
/// |
1286 | 1286 |
/// This function changes the second node of the given edge \c e to \c n. |
1287 | 1287 |
/// |
1288 | 1288 |
///\note \c EdgeIt iterators referencing the changed edge remain |
1289 |
///valid, |
|
1289 |
///valid, but \c ArcIt iterators referencing the changed edge and |
|
1290 | 1290 |
///all other iterators whose base node is the changed node are also |
1291 | 1291 |
///invalidated. |
1292 | 1292 |
/// |
1293 | 1293 |
///\warning This functionality cannot be used together with the |
1294 | 1294 |
///Snapshot feature. |
1295 | 1295 |
void changeV(Edge e, Node n) { |
1296 | 1296 |
Parent::changeV(e,n); |
1297 | 1297 |
} |
... | ... |
@@ -1366,17 +1366,17 @@ |
1366 | 1366 |
/// |
1367 | 1367 |
/// \note After a state is restored, you cannot restore a later state, |
1368 | 1368 |
/// i.e. you cannot add the removed nodes and edges again using |
1369 | 1369 |
/// another Snapshot instance. |
1370 | 1370 |
/// |
1371 | 1371 |
/// \warning Node and edge deletions and other modifications |
1372 | 1372 |
/// (e.g. changing the end-nodes of edges or contracting nodes) |
1373 | 1373 |
/// cannot be restored. These events invalidate the snapshot. |
1374 |
/// However the edges and nodes that were added to the graph after |
|
1374 |
/// However, the edges and nodes that were added to the graph after |
|
1375 | 1375 |
/// making the current snapshot can be removed without invalidating it. |
1376 | 1376 |
class Snapshot { |
1377 | 1377 |
protected: |
1378 | 1378 |
|
1379 | 1379 |
typedef Parent::NodeNotifier NodeNotifier; |
1380 | 1380 |
|
1381 | 1381 |
class NodeObserverProxy : public NodeNotifier::ObserverBase { |
1382 | 1382 |
public: |
... | ... |
@@ -141,17 +141,17 @@ |
141 | 141 |
/// \note This operator only have to define some strict ordering of |
142 | 142 |
/// the items; this order has nothing to do with the iteration |
143 | 143 |
/// ordering of the items. |
144 | 144 |
bool operator<(Col c) const {return _id < c._id;} |
145 | 145 |
}; |
146 | 146 |
|
147 | 147 |
///Iterator for iterate over the columns of an LP problem |
148 | 148 |
|
149 |
/// Its usage is quite simple, for example you can count the number |
|
149 |
/// Its usage is quite simple, for example, you can count the number |
|
150 | 150 |
/// of columns in an LP \c lp: |
151 | 151 |
///\code |
152 | 152 |
/// int count=0; |
153 | 153 |
/// for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count; |
154 | 154 |
///\endcode |
155 | 155 |
class ColIt : public Col { |
156 | 156 |
const LpBase *_solver; |
157 | 157 |
public: |
... | ... |
@@ -236,17 +236,17 @@ |
236 | 236 |
/// \note This operator only have to define some strict ordering of |
237 | 237 |
/// the items; this order has nothing to do with the iteration |
238 | 238 |
/// ordering of the items. |
239 | 239 |
bool operator<(Row r) const {return _id < r._id;} |
240 | 240 |
}; |
241 | 241 |
|
242 | 242 |
///Iterator for iterate over the rows of an LP problem |
243 | 243 |
|
244 |
/// Its usage is quite simple, for example you can count the number |
|
244 |
/// Its usage is quite simple, for example, you can count the number |
|
245 | 245 |
/// of rows in an LP \c lp: |
246 | 246 |
///\code |
247 | 247 |
/// int count=0; |
248 | 248 |
/// for (LpBase::RowIt c(lp); c!=INVALID; ++c) ++count; |
249 | 249 |
///\endcode |
250 | 250 |
class RowIt : public Row { |
251 | 251 |
const LpBase *_solver; |
252 | 252 |
public: |
... | ... |
@@ -225,20 +225,20 @@ |
225 | 225 |
} |
226 | 226 |
|
227 | 227 |
|
228 | 228 |
/// \brief Map for storing values for integer keys from the range |
229 | 229 |
/// <tt>[0..size-1]</tt>. |
230 | 230 |
/// |
231 | 231 |
/// This map is essentially a wrapper for \c std::vector. It assigns |
232 | 232 |
/// values to integer keys from the range <tt>[0..size-1]</tt>. |
233 |
/// It can be used with some data structures, for example |
|
234 |
/// \c UnionFind, \c BinHeap, when the used items are small |
|
233 |
/// It can be used together with some data structures, e.g. |
|
234 |
/// heap types and \c UnionFind, when the used items are small |
|
235 | 235 |
/// integers. This map conforms to the \ref concepts::ReferenceMap |
236 |
/// "ReferenceMap" concept. |
|
236 |
/// "ReferenceMap" concept. |
|
237 | 237 |
/// |
238 | 238 |
/// The simplest way of using this map is through the rangeMap() |
239 | 239 |
/// function. |
240 | 240 |
template <typename V> |
241 | 241 |
class RangeMap : public MapBase<int, V> { |
242 | 242 |
template <typename V1> |
243 | 243 |
friend class RangeMap; |
244 | 244 |
private: |
... | ... |
@@ -343,19 +343,19 @@ |
343 | 343 |
/// This type conforms to the \ref concepts::ReferenceMap "ReferenceMap" |
344 | 344 |
/// concept. |
345 | 345 |
/// |
346 | 346 |
/// This map is useful if a default value should be assigned to most of |
347 | 347 |
/// the keys and different values should be assigned only to a few |
348 | 348 |
/// keys (i.e. the map is "sparse"). |
349 | 349 |
/// The name of this type also refers to this important usage. |
350 | 350 |
/// |
351 |
/// Apart form that this map can be used in many other cases since it |
|
351 |
/// Apart form that, this map can be used in many other cases since it |
|
352 | 352 |
/// is based on \c std::map, which is a general associative container. |
353 |
/// However keep in mind that it is usually not as efficient as other |
|
353 |
/// However, keep in mind that it is usually not as efficient as other |
|
354 | 354 |
/// maps. |
355 | 355 |
/// |
356 | 356 |
/// The simplest way of using this map is through the sparseMap() |
357 | 357 |
/// function. |
358 | 358 |
template <typename K, typename V, typename Comp = std::less<K> > |
359 | 359 |
class SparseMap : public MapBase<K, V> { |
360 | 360 |
template <typename K1, typename V1, typename C1> |
361 | 361 |
friend class SparseMap; |
... | ... |
@@ -1780,32 +1780,32 @@ |
1780 | 1780 |
}; |
1781 | 1781 |
|
1782 | 1782 |
/// Returns a \c LoggerBoolMap class |
1783 | 1783 |
|
1784 | 1784 |
/// This function just returns a \c LoggerBoolMap class. |
1785 | 1785 |
/// |
1786 | 1786 |
/// The most important usage of it is storing certain nodes or arcs |
1787 | 1787 |
/// that were marked \c true by an algorithm. |
1788 |
/// For example it makes easier to store the nodes in the processing |
|
1788 |
/// For example, it makes easier to store the nodes in the processing |
|
1789 | 1789 |
/// order of Dfs algorithm, as the following examples show. |
1790 | 1790 |
/// \code |
1791 | 1791 |
/// std::vector<Node> v; |
1792 | 1792 |
/// dfs(g).processedMap(loggerBoolMap(std::back_inserter(v))).run(s); |
1793 | 1793 |
/// \endcode |
1794 | 1794 |
/// \code |
1795 | 1795 |
/// std::vector<Node> v(countNodes(g)); |
1796 | 1796 |
/// dfs(g).processedMap(loggerBoolMap(v.begin())).run(s); |
1797 | 1797 |
/// \endcode |
1798 | 1798 |
/// |
1799 | 1799 |
/// \note The container of the iterator must contain enough space |
1800 | 1800 |
/// for the elements or the iterator should be an inserter iterator. |
1801 | 1801 |
/// |
1802 | 1802 |
/// \note LoggerBoolMap is just \ref concepts::WriteMap "writable", so |
1803 |
/// it cannot be used when a readable map is needed, for example as |
|
1803 |
/// it cannot be used when a readable map is needed, for example, as |
|
1804 | 1804 |
/// \c ReachedMap for \c Bfs, \c Dfs and \c Dijkstra algorithms. |
1805 | 1805 |
/// |
1806 | 1806 |
/// \relates LoggerBoolMap |
1807 | 1807 |
template<typename Iterator> |
1808 | 1808 |
inline LoggerBoolMap<Iterator> loggerBoolMap(Iterator it) { |
1809 | 1809 |
return LoggerBoolMap<Iterator>(it); |
1810 | 1810 |
} |
1811 | 1811 |
|
... | ... |
@@ -1917,17 +1917,17 @@ |
1917 | 1917 |
/// \c InverseMap or \c operator()(), and the values of the map can be |
1918 | 1918 |
/// accessed with an STL compatible forward iterator (\c ValueIt). |
1919 | 1919 |
/// |
1920 | 1920 |
/// This map is intended to be used when all associated values are |
1921 | 1921 |
/// different (the map is actually invertable) or there are only a few |
1922 | 1922 |
/// items with the same value. |
1923 | 1923 |
/// Otherwise consider to use \c IterableValueMap, which is more |
1924 | 1924 |
/// suitable and more efficient for such cases. It provides iterators |
1925 |
/// to traverse the items with the same associated value, |
|
1925 |
/// to traverse the items with the same associated value, but |
|
1926 | 1926 |
/// it does not have \c InverseMap. |
1927 | 1927 |
/// |
1928 | 1928 |
/// This type is not reference map, so it cannot be modified with |
1929 | 1929 |
/// the subscript operator. |
1930 | 1930 |
/// |
1931 | 1931 |
/// \tparam GR The graph type. |
1932 | 1932 |
/// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or |
1933 | 1933 |
/// \c GR::Edge). |
... | ... |
@@ -3461,17 +3461,17 @@ |
3461 | 3461 |
/// This map returns the in-degree of a node. Once it is constructed, |
3462 | 3462 |
/// the degrees are stored in a standard \c NodeMap, so each query is done |
3463 | 3463 |
/// in constant time. On the other hand, the values are updated automatically |
3464 | 3464 |
/// whenever the digraph changes. |
3465 | 3465 |
/// |
3466 | 3466 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
3467 | 3467 |
/// may provide alternative ways to modify the digraph. |
3468 | 3468 |
/// The correct behavior of InDegMap is not guarantied if these additional |
3469 |
/// features are used. For example the functions |
|
3469 |
/// features are used. For example, the functions |
|
3470 | 3470 |
/// \ref ListDigraph::changeSource() "changeSource()", |
3471 | 3471 |
/// \ref ListDigraph::changeTarget() "changeTarget()" and |
3472 | 3472 |
/// \ref ListDigraph::reverseArc() "reverseArc()" |
3473 | 3473 |
/// of \ref ListDigraph will \e not update the degree values correctly. |
3474 | 3474 |
/// |
3475 | 3475 |
/// \sa OutDegMap |
3476 | 3476 |
template <typename GR> |
3477 | 3477 |
class InDegMap |
... | ... |
@@ -3591,17 +3591,17 @@ |
3591 | 3591 |
/// This map returns the out-degree of a node. Once it is constructed, |
3592 | 3592 |
/// the degrees are stored in a standard \c NodeMap, so each query is done |
3593 | 3593 |
/// in constant time. On the other hand, the values are updated automatically |
3594 | 3594 |
/// whenever the digraph changes. |
3595 | 3595 |
/// |
3596 | 3596 |
/// \warning Besides \c addNode() and \c addArc(), a digraph structure |
3597 | 3597 |
/// may provide alternative ways to modify the digraph. |
3598 | 3598 |
/// The correct behavior of OutDegMap is not guarantied if these additional |
3599 |
/// features are used. For example the functions |
|
3599 |
/// features are used. For example, the functions |
|
3600 | 3600 |
/// \ref ListDigraph::changeSource() "changeSource()", |
3601 | 3601 |
/// \ref ListDigraph::changeTarget() "changeTarget()" and |
3602 | 3602 |
/// \ref ListDigraph::reverseArc() "reverseArc()" |
3603 | 3603 |
/// of \ref ListDigraph will \e not update the degree values correctly. |
3604 | 3604 |
/// |
3605 | 3605 |
/// \sa InDegMap |
3606 | 3606 |
template <typename GR> |
3607 | 3607 |
class OutDegMap |
... | ... |
@@ -45,35 +45,35 @@ |
45 | 45 |
/// \ref kellyoneill91netsimplex. |
46 | 46 |
/// This algorithm is a specialized version of the linear programming |
47 | 47 |
/// simplex method directly for the minimum cost flow problem. |
48 | 48 |
/// It is one of the most efficient solution methods. |
49 | 49 |
/// |
50 | 50 |
/// In general this class is the fastest implementation available |
51 | 51 |
/// in LEMON for the minimum cost flow problem. |
52 | 52 |
/// Moreover it supports both directions of the supply/demand inequality |
53 |
/// constraints. For more information see \ref SupplyType. |
|
53 |
/// constraints. For more information, see \ref SupplyType. |
|
54 | 54 |
/// |
55 | 55 |
/// Most of the parameters of the problem (except for the digraph) |
56 | 56 |
/// can be given using separate functions, and the algorithm can be |
57 | 57 |
/// executed using the \ref run() function. If some parameters are not |
58 | 58 |
/// specified, then default values will be used. |
59 | 59 |
/// |
60 | 60 |
/// \tparam GR The digraph type the algorithm runs on. |
61 | 61 |
/// \tparam V The value type used for flow amounts, capacity bounds |
62 |
/// and supply values in the algorithm. By default it is \c int. |
|
62 |
/// and supply values in the algorithm. By default, it is \c int. |
|
63 | 63 |
/// \tparam C The value type used for costs and potentials in the |
64 |
/// algorithm. By default it is the same as \c V. |
|
64 |
/// algorithm. By default, it is the same as \c V. |
|
65 | 65 |
/// |
66 | 66 |
/// \warning Both value types must be signed and all input data must |
67 | 67 |
/// be integer. |
68 | 68 |
/// |
69 | 69 |
/// \note %NetworkSimplex provides five different pivot rule |
70 | 70 |
/// implementations, from which the most efficient one is used |
71 |
/// by default. For more information see \ref PivotRule. |
|
71 |
/// by default. For more information, see \ref PivotRule. |
|
72 | 72 |
template <typename GR, typename V = int, typename C = V> |
73 | 73 |
class NetworkSimplex |
74 | 74 |
{ |
75 | 75 |
public: |
76 | 76 |
|
77 | 77 |
/// The type of the flow amounts, capacity bounds and supply values |
78 | 78 |
typedef V Value; |
79 | 79 |
/// The type of the arc costs |
... | ... |
@@ -119,45 +119,45 @@ |
119 | 119 |
/// \brief Constants for selecting the pivot rule. |
120 | 120 |
/// |
121 | 121 |
/// Enum type containing constants for selecting the pivot rule for |
122 | 122 |
/// the \ref run() function. |
123 | 123 |
/// |
124 | 124 |
/// \ref NetworkSimplex provides five different pivot rule |
125 | 125 |
/// implementations that significantly affect the running time |
126 | 126 |
/// of the algorithm. |
127 |
/// By default \ref BLOCK_SEARCH "Block Search" is used, which |
|
127 |
/// By default, \ref BLOCK_SEARCH "Block Search" is used, which |
|
128 | 128 |
/// proved to be the most efficient and the most robust on various |
129 | 129 |
/// test inputs according to our benchmark tests. |
130 |
/// However another pivot rule can be selected using the \ref run() |
|
130 |
/// However, another pivot rule can be selected using the \ref run() |
|
131 | 131 |
/// function with the proper parameter. |
132 | 132 |
enum PivotRule { |
133 | 133 |
|
134 |
/// The First Eligible pivot rule. |
|
134 |
/// The \e First \e Eligible pivot rule. |
|
135 | 135 |
/// The next eligible arc is selected in a wraparound fashion |
136 | 136 |
/// in every iteration. |
137 | 137 |
FIRST_ELIGIBLE, |
138 | 138 |
|
139 |
/// The Best Eligible pivot rule. |
|
139 |
/// The \e Best \e Eligible pivot rule. |
|
140 | 140 |
/// The best eligible arc is selected in every iteration. |
141 | 141 |
BEST_ELIGIBLE, |
142 | 142 |
|
143 |
/// The Block Search pivot rule. |
|
143 |
/// The \e Block \e Search pivot rule. |
|
144 | 144 |
/// A specified number of arcs are examined in every iteration |
145 | 145 |
/// in a wraparound fashion and the best eligible arc is selected |
146 | 146 |
/// from this block. |
147 | 147 |
BLOCK_SEARCH, |
148 | 148 |
|
149 |
/// The Candidate List pivot rule. |
|
149 |
/// The \e Candidate \e List pivot rule. |
|
150 | 150 |
/// In a major iteration a candidate list is built from eligible arcs |
151 | 151 |
/// in a wraparound fashion and in the following minor iterations |
152 | 152 |
/// the best eligible arc is selected from this list. |
153 | 153 |
CANDIDATE_LIST, |
154 | 154 |
|
155 |
/// The Altering Candidate List pivot rule. |
|
155 |
/// The \e Altering \e Candidate \e List pivot rule. |
|
156 | 156 |
/// It is a modified version of the Candidate List method. |
157 | 157 |
/// It keeps only the several best eligible arcs from the former |
158 | 158 |
/// candidate list and extends this list in every iteration. |
159 | 159 |
ALTERING_LIST |
160 | 160 |
}; |
161 | 161 |
|
162 | 162 |
private: |
163 | 163 |
|
... | ... |
@@ -807,17 +807,17 @@ |
807 | 807 |
} |
808 | 808 |
|
809 | 809 |
/// \brief Set the type of the supply constraints. |
810 | 810 |
/// |
811 | 811 |
/// This function sets the type of the supply/demand constraints. |
812 | 812 |
/// If it is not used before calling \ref run(), the \ref GEQ supply |
813 | 813 |
/// type will be used. |
814 | 814 |
/// |
815 |
/// For more information see \ref SupplyType. |
|
815 |
/// For more information, see \ref SupplyType. |
|
816 | 816 |
/// |
817 | 817 |
/// \return <tt>(*this)</tt> |
818 | 818 |
NetworkSimplex& supplyType(SupplyType supply_type) { |
819 | 819 |
_stype = supply_type; |
820 | 820 |
return *this; |
821 | 821 |
} |
822 | 822 |
|
823 | 823 |
/// @} |
... | ... |
@@ -839,21 +839,21 @@ |
839 | 839 |
/// ns.lowerMap(lower).upperMap(upper).costMap(cost) |
840 | 840 |
/// .supplyMap(sup).run(); |
841 | 841 |
/// \endcode |
842 | 842 |
/// |
843 | 843 |
/// This function can be called more than once. All the parameters |
844 | 844 |
/// that have been given are kept for the next call, unless |
845 | 845 |
/// \ref reset() is called, thus only the modified parameters |
846 | 846 |
/// have to be set again. See \ref reset() for examples. |
847 |
/// However the underlying digraph must not be modified after this |
|
847 |
/// However, the underlying digraph must not be modified after this |
|
848 | 848 |
/// class have been constructed, since it copies and extends the graph. |
849 | 849 |
/// |
850 | 850 |
/// \param pivot_rule The pivot rule that will be used during the |
851 |
/// algorithm. For more information see \ref PivotRule. |
|
851 |
/// algorithm. For more information, see \ref PivotRule. |
|
852 | 852 |
/// |
853 | 853 |
/// \return \c INFEASIBLE if no feasible flow exists, |
854 | 854 |
/// \n \c OPTIMAL if the problem has optimal solution |
855 | 855 |
/// (i.e. it is feasible and bounded), and the algorithm has found |
856 | 856 |
/// optimal flow and node potentials (primal and dual solutions), |
857 | 857 |
/// \n \c UNBOUNDED if the objective function of the problem is |
858 | 858 |
/// unbounded, i.e. there is a directed cycle having negative total |
859 | 859 |
/// cost and infinite upper bound. |
... | ... |
@@ -868,17 +868,17 @@ |
868 | 868 |
/// |
869 | 869 |
/// This function resets all the paramaters that have been given |
870 | 870 |
/// before using functions \ref lowerMap(), \ref upperMap(), |
871 | 871 |
/// \ref costMap(), \ref supplyMap(), \ref stSupply(), \ref supplyType(). |
872 | 872 |
/// |
873 | 873 |
/// It is useful for multiple run() calls. If this function is not |
874 | 874 |
/// used, all the parameters given before are kept for the next |
875 | 875 |
/// \ref run() call. |
876 |
/// However the underlying digraph must not be modified after this |
|
876 |
/// However, the underlying digraph must not be modified after this |
|
877 | 877 |
/// class have been constructed, since it copies and extends the graph. |
878 | 878 |
/// |
879 | 879 |
/// For example, |
880 | 880 |
/// \code |
881 | 881 |
/// NetworkSimplex<ListDigraph> ns(graph); |
882 | 882 |
/// |
883 | 883 |
/// // First run |
884 | 884 |
/// ns.lowerMap(lower).upperMap(upper).costMap(cost) |
... | ... |
@@ -260,17 +260,17 @@ |
260 | 260 |
/// \brief \ref named-templ-param "Named parameter" for setting |
261 | 261 |
/// Elevator type with automatic allocation |
262 | 262 |
/// |
263 | 263 |
/// \ref named-templ-param "Named parameter" for setting Elevator |
264 | 264 |
/// type with automatic allocation. |
265 | 265 |
/// The Elevator should have standard constructor interface to be |
266 | 266 |
/// able to automatically created by the algorithm (i.e. the |
267 | 267 |
/// digraph and the maximum level should be passed to it). |
268 |
/// However an external elevator object could also be passed to the |
|
268 |
/// However, an external elevator object could also be passed to the |
|
269 | 269 |
/// algorithm with the \ref elevator(Elevator&) "elevator()" function |
270 | 270 |
/// before calling \ref run() or \ref init(). |
271 | 271 |
/// \sa SetElevator |
272 | 272 |
template <typename T> |
273 | 273 |
struct SetStandardElevator |
274 | 274 |
: public Preflow<Digraph, CapacityMap, |
275 | 275 |
SetStandardElevatorTraits<T> > { |
276 | 276 |
typedef Preflow<Digraph, CapacityMap, |
... | ... |
@@ -370,17 +370,17 @@ |
370 | 370 |
start_time=t-start_time; |
371 | 371 |
} |
372 | 372 |
} |
373 | 373 |
|
374 | 374 |
///Returns the running state of the timer |
375 | 375 |
|
376 | 376 |
///This function returns the number of stop() exections that is |
377 | 377 |
///necessary to really stop the timer. |
378 |
///For example the timer |
|
378 |
///For example, the timer |
|
379 | 379 |
///is running if and only if the return value is \c true |
380 | 380 |
///(i.e. greater than |
381 | 381 |
///zero). |
382 | 382 |
int running() { return _running; } |
383 | 383 |
|
384 | 384 |
|
385 | 385 |
///Restart the time counters |
386 | 386 |
... | ... |
@@ -38,17 +38,17 @@ |
38 | 38 |
/// |
39 | 39 |
/// \brief A \e Union-Find data structure implementation |
40 | 40 |
/// |
41 | 41 |
/// The class implements the \e Union-Find data structure. |
42 | 42 |
/// The union operation uses rank heuristic, while |
43 | 43 |
/// the find operation uses path compression. |
44 | 44 |
/// This is a very simple but efficient implementation, providing |
45 | 45 |
/// only four methods: join (union), find, insert and size. |
46 |
/// For more features see the \ref UnionFindEnum class. |
|
46 |
/// For more features, see the \ref UnionFindEnum class. |
|
47 | 47 |
/// |
48 | 48 |
/// It is primarily used in Kruskal algorithm for finding minimal |
49 | 49 |
/// cost spanning tree in a graph. |
50 | 50 |
/// \sa kruskal() |
51 | 51 |
/// |
52 | 52 |
/// \pre You need to add all the elements by the \ref insert() |
53 | 53 |
/// method. |
54 | 54 |
template <typename IM> |
0 comments (0 inline)