klao@959
|
1 |
/* -*- C++ -*-
|
klao@959
|
2 |
*
|
alpar@1956
|
3 |
* This file is a part of LEMON, a generic C++ optimization library
|
alpar@1956
|
4 |
*
|
alpar@1956
|
5 |
* Copyright (C) 2003-2006
|
alpar@1956
|
6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
|
alpar@1359
|
7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES).
|
klao@959
|
8 |
*
|
klao@959
|
9 |
* Permission to use, modify and distribute this software is granted
|
klao@959
|
10 |
* provided that this copyright notice appears in all copies. For
|
klao@959
|
11 |
* precise terms see the accompanying LICENSE file.
|
klao@959
|
12 |
*
|
klao@959
|
13 |
* This software is provided "AS IS" with no warranty of any kind,
|
klao@959
|
14 |
* express or implied, and with no claim as to its suitability for any
|
klao@959
|
15 |
* purpose.
|
klao@959
|
16 |
*
|
klao@959
|
17 |
*/
|
klao@959
|
18 |
|
klao@959
|
19 |
#ifndef LEMON_CONCEPT_GRAPH_H
|
klao@959
|
20 |
#define LEMON_CONCEPT_GRAPH_H
|
klao@959
|
21 |
|
klao@1030
|
22 |
///\ingroup graph_concepts
|
klao@959
|
23 |
///\file
|
klao@959
|
24 |
///\brief Declaration of Graph.
|
klao@959
|
25 |
|
deba@1993
|
26 |
#include <lemon/bits/invalid.h>
|
deba@1993
|
27 |
#include <lemon/bits/utility.h>
|
klao@959
|
28 |
#include <lemon/concept/maps.h>
|
klao@959
|
29 |
#include <lemon/concept_check.h>
|
klao@959
|
30 |
#include <lemon/concept/graph_component.h>
|
klao@959
|
31 |
|
klao@959
|
32 |
namespace lemon {
|
klao@959
|
33 |
namespace concept {
|
deba@1136
|
34 |
|
klao@959
|
35 |
|
klao@961
|
36 |
/**************** The full-featured graph concepts ****************/
|
klao@959
|
37 |
|
deba@1136
|
38 |
|
klao@1760
|
39 |
// \brief Modular static graph class.
|
klao@1760
|
40 |
//
|
deba@2111
|
41 |
// It should be the same as the \c Graph class.
|
deba@2111
|
42 |
class _Graph
|
klao@961
|
43 |
: virtual public BaseGraphComponent,
|
ladanyi@1426
|
44 |
public IterableGraphComponent, public MappableGraphComponent {
|
klao@959
|
45 |
public:
|
alpar@1448
|
46 |
|
klao@959
|
47 |
typedef BaseGraphComponent::Node Node;
|
klao@959
|
48 |
typedef BaseGraphComponent::Edge Edge;
|
klao@959
|
49 |
|
deba@989
|
50 |
template <typename _Graph>
|
deba@989
|
51 |
struct Constraints {
|
ladanyi@1426
|
52 |
void constraints() {
|
ladanyi@1426
|
53 |
checkConcept<IterableGraphComponent, _Graph>();
|
ladanyi@1426
|
54 |
checkConcept<MappableGraphComponent, _Graph>();
|
ladanyi@1426
|
55 |
}
|
deba@989
|
56 |
};
|
klao@959
|
57 |
};
|
klao@959
|
58 |
|
alpar@1620
|
59 |
/// \addtogroup graph_concepts
|
alpar@1620
|
60 |
/// @{
|
alpar@1620
|
61 |
|
deba@2111
|
62 |
/// An empty graph class.
|
deba@1136
|
63 |
|
deba@1136
|
64 |
/// This class provides all the common features of a graph structure,
|
deba@1136
|
65 |
/// however completely without implementations and real data structures
|
deba@1136
|
66 |
/// behind the interface.
|
deba@1136
|
67 |
/// All graph algorithms should compile with this class, but it will not
|
deba@1136
|
68 |
/// run properly, of course.
|
deba@1136
|
69 |
///
|
deba@1136
|
70 |
/// It can be used for checking the interface compatibility,
|
deba@1136
|
71 |
/// or it can serve as a skeleton of a new graph structure.
|
deba@1136
|
72 |
///
|
deba@1136
|
73 |
/// Also, you will find here the full documentation of a certain graph
|
deba@1136
|
74 |
/// feature, the documentation of a real graph imlementation
|
deba@1136
|
75 |
/// like @ref ListGraph or
|
deba@1136
|
76 |
/// @ref SmartGraph will just refer to this structure.
|
deba@1136
|
77 |
///
|
deba@1136
|
78 |
/// \todo A pages describing the concept of concept description would
|
deba@1136
|
79 |
/// be nice.
|
deba@2111
|
80 |
class Graph {
|
deba@1136
|
81 |
public:
|
alpar@1448
|
82 |
///\e
|
alpar@1448
|
83 |
|
deba@1136
|
84 |
/// Defalult constructor.
|
deba@1136
|
85 |
|
deba@1136
|
86 |
/// Defalult constructor.
|
deba@1136
|
87 |
///
|
deba@2111
|
88 |
Graph() { }
|
deba@1136
|
89 |
|
deba@1136
|
90 |
/// The base type of node iterators,
|
deba@1136
|
91 |
/// or in other words, the trivial node iterator.
|
deba@1136
|
92 |
|
deba@1136
|
93 |
/// This is the base type of each node iterator,
|
deba@1136
|
94 |
/// thus each kind of node iterator converts to this.
|
deba@1136
|
95 |
/// More precisely each kind of node iterator should be inherited
|
deba@1136
|
96 |
/// from the trivial node iterator.
|
deba@1136
|
97 |
class Node {
|
deba@1136
|
98 |
public:
|
ladanyi@1426
|
99 |
/// Default constructor
|
deba@1136
|
100 |
|
ladanyi@1426
|
101 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
102 |
/// to an undefined value.
|
ladanyi@1426
|
103 |
Node() { }
|
ladanyi@1426
|
104 |
/// Copy constructor.
|
deba@1136
|
105 |
|
ladanyi@1426
|
106 |
/// Copy constructor.
|
ladanyi@1426
|
107 |
///
|
ladanyi@1426
|
108 |
Node(const Node&) { }
|
deba@1136
|
109 |
|
ladanyi@1426
|
110 |
/// Invalid constructor \& conversion.
|
deba@1136
|
111 |
|
ladanyi@1426
|
112 |
/// This constructor initializes the iterator to be invalid.
|
ladanyi@1426
|
113 |
/// \sa Invalid for more details.
|
ladanyi@1426
|
114 |
Node(Invalid) { }
|
ladanyi@1426
|
115 |
/// Equality operator
|
deba@1136
|
116 |
|
ladanyi@1426
|
117 |
/// Two iterators are equal if and only if they point to the
|
ladanyi@1426
|
118 |
/// same object or both are invalid.
|
ladanyi@1426
|
119 |
bool operator==(Node) const { return true; }
|
deba@1136
|
120 |
|
ladanyi@1426
|
121 |
/// Inequality operator
|
ladanyi@1426
|
122 |
|
ladanyi@1426
|
123 |
/// \sa operator==(Node n)
|
ladanyi@1426
|
124 |
///
|
ladanyi@1426
|
125 |
bool operator!=(Node) const { return true; }
|
deba@1136
|
126 |
|
deba@1622
|
127 |
/// Artificial ordering operator.
|
deba@1622
|
128 |
|
deba@1622
|
129 |
/// To allow the use of graph descriptors as key type in std::map or
|
deba@1622
|
130 |
/// similar associative container we require this.
|
deba@1622
|
131 |
///
|
deba@1622
|
132 |
/// \note This operator only have to define some strict ordering of
|
deba@1622
|
133 |
/// the items; this order has nothing to do with the iteration
|
deba@1622
|
134 |
/// ordering of the items.
|
deba@1622
|
135 |
///
|
deba@1622
|
136 |
/// \bug This is a technical requirement. Do we really need this?
|
deba@1622
|
137 |
bool operator<(Node) const { return false; }
|
deba@1622
|
138 |
|
deba@1136
|
139 |
};
|
deba@1136
|
140 |
|
deba@1136
|
141 |
/// This iterator goes through each node.
|
deba@1136
|
142 |
|
deba@1136
|
143 |
/// This iterator goes through each node.
|
deba@1136
|
144 |
/// Its usage is quite simple, for example you can count the number
|
deba@1136
|
145 |
/// of nodes in graph \c g of type \c Graph like this:
|
alpar@1946
|
146 |
///\code
|
deba@1136
|
147 |
/// int count=0;
|
ladanyi@1426
|
148 |
/// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count;
|
alpar@1946
|
149 |
///\endcode
|
deba@1136
|
150 |
class NodeIt : public Node {
|
deba@1136
|
151 |
public:
|
ladanyi@1426
|
152 |
/// Default constructor
|
deba@1136
|
153 |
|
ladanyi@1426
|
154 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
155 |
/// to an undefined value.
|
ladanyi@1426
|
156 |
NodeIt() { }
|
ladanyi@1426
|
157 |
/// Copy constructor.
|
ladanyi@1426
|
158 |
|
ladanyi@1426
|
159 |
/// Copy constructor.
|
ladanyi@1426
|
160 |
///
|
ladanyi@1426
|
161 |
NodeIt(const NodeIt& n) : Node(n) { }
|
ladanyi@1426
|
162 |
/// Invalid constructor \& conversion.
|
deba@1136
|
163 |
|
ladanyi@1426
|
164 |
/// Initialize the iterator to be invalid.
|
ladanyi@1426
|
165 |
/// \sa Invalid for more details.
|
ladanyi@1426
|
166 |
NodeIt(Invalid) { }
|
ladanyi@1426
|
167 |
/// Sets the iterator to the first node.
|
deba@1136
|
168 |
|
ladanyi@1426
|
169 |
/// Sets the iterator to the first node of \c g.
|
ladanyi@1426
|
170 |
///
|
deba@2111
|
171 |
NodeIt(const Graph&) { }
|
ladanyi@1426
|
172 |
/// Node -> NodeIt conversion.
|
deba@1136
|
173 |
|
deba@1470
|
174 |
/// Sets the iterator to the node of \c the graph pointed by
|
deba@1470
|
175 |
/// the trivial iterator.
|
ladanyi@1426
|
176 |
/// This feature necessitates that each time we
|
ladanyi@1426
|
177 |
/// iterate the edge-set, the iteration order is the same.
|
deba@2111
|
178 |
NodeIt(const Graph&, const Node&) { }
|
ladanyi@1426
|
179 |
/// Next node.
|
deba@1136
|
180 |
|
ladanyi@1426
|
181 |
/// Assign the iterator to the next node.
|
ladanyi@1426
|
182 |
///
|
ladanyi@1426
|
183 |
NodeIt& operator++() { return *this; }
|
deba@1136
|
184 |
};
|
deba@1136
|
185 |
|
deba@1136
|
186 |
|
deba@1136
|
187 |
/// The base type of the edge iterators.
|
deba@1136
|
188 |
|
deba@1136
|
189 |
/// The base type of the edge iterators.
|
deba@1136
|
190 |
///
|
deba@1136
|
191 |
class Edge {
|
deba@1136
|
192 |
public:
|
ladanyi@1426
|
193 |
/// Default constructor
|
deba@1136
|
194 |
|
ladanyi@1426
|
195 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
196 |
/// to an undefined value.
|
ladanyi@1426
|
197 |
Edge() { }
|
ladanyi@1426
|
198 |
/// Copy constructor.
|
deba@1136
|
199 |
|
ladanyi@1426
|
200 |
/// Copy constructor.
|
ladanyi@1426
|
201 |
///
|
ladanyi@1426
|
202 |
Edge(const Edge&) { }
|
ladanyi@1426
|
203 |
/// Initialize the iterator to be invalid.
|
deba@1136
|
204 |
|
ladanyi@1426
|
205 |
/// Initialize the iterator to be invalid.
|
ladanyi@1426
|
206 |
///
|
ladanyi@1426
|
207 |
Edge(Invalid) { }
|
ladanyi@1426
|
208 |
/// Equality operator
|
deba@1136
|
209 |
|
ladanyi@1426
|
210 |
/// Two iterators are equal if and only if they point to the
|
ladanyi@1426
|
211 |
/// same object or both are invalid.
|
ladanyi@1426
|
212 |
bool operator==(Edge) const { return true; }
|
ladanyi@1426
|
213 |
/// Inequality operator
|
deba@1136
|
214 |
|
alpar@1620
|
215 |
/// \sa operator==(Edge n)
|
ladanyi@1426
|
216 |
///
|
ladanyi@1426
|
217 |
bool operator!=(Edge) const { return true; }
|
deba@1622
|
218 |
|
deba@1622
|
219 |
/// Artificial ordering operator.
|
deba@1622
|
220 |
|
deba@1622
|
221 |
/// To allow the use of graph descriptors as key type in std::map or
|
deba@1622
|
222 |
/// similar associative container we require this.
|
deba@1622
|
223 |
///
|
deba@1622
|
224 |
/// \note This operator only have to define some strict ordering of
|
deba@1622
|
225 |
/// the items; this order has nothing to do with the iteration
|
deba@1622
|
226 |
/// ordering of the items.
|
deba@1622
|
227 |
///
|
deba@1622
|
228 |
/// \bug This is a technical requirement. Do we really need this?
|
deba@1622
|
229 |
bool operator<(Edge) const { return false; }
|
deba@1136
|
230 |
};
|
deba@1136
|
231 |
|
deba@1136
|
232 |
/// This iterator goes trough the outgoing edges of a node.
|
deba@1136
|
233 |
|
deba@1136
|
234 |
/// This iterator goes trough the \e outgoing edges of a certain node
|
deba@1136
|
235 |
/// of a graph.
|
deba@1136
|
236 |
/// Its usage is quite simple, for example you can count the number
|
deba@1136
|
237 |
/// of outgoing edges of a node \c n
|
deba@1136
|
238 |
/// in graph \c g of type \c Graph as follows.
|
alpar@1946
|
239 |
///\code
|
deba@1136
|
240 |
/// int count=0;
|
deba@1136
|
241 |
/// for (Graph::OutEdgeIt e(g, n); e!=INVALID; ++e) ++count;
|
alpar@1946
|
242 |
///\endcode
|
deba@1136
|
243 |
|
deba@1136
|
244 |
class OutEdgeIt : public Edge {
|
deba@1136
|
245 |
public:
|
ladanyi@1426
|
246 |
/// Default constructor
|
deba@1136
|
247 |
|
ladanyi@1426
|
248 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
249 |
/// to an undefined value.
|
ladanyi@1426
|
250 |
OutEdgeIt() { }
|
ladanyi@1426
|
251 |
/// Copy constructor.
|
deba@1136
|
252 |
|
ladanyi@1426
|
253 |
/// Copy constructor.
|
ladanyi@1426
|
254 |
///
|
ladanyi@1426
|
255 |
OutEdgeIt(const OutEdgeIt& e) : Edge(e) { }
|
ladanyi@1426
|
256 |
/// Initialize the iterator to be invalid.
|
deba@1136
|
257 |
|
ladanyi@1426
|
258 |
/// Initialize the iterator to be invalid.
|
ladanyi@1426
|
259 |
///
|
ladanyi@1426
|
260 |
OutEdgeIt(Invalid) { }
|
ladanyi@1426
|
261 |
/// This constructor sets the iterator to the first outgoing edge.
|
deba@1136
|
262 |
|
ladanyi@1426
|
263 |
/// This constructor sets the iterator to the first outgoing edge of
|
ladanyi@1426
|
264 |
/// the node.
|
deba@2111
|
265 |
OutEdgeIt(const Graph&, const Node&) { }
|
ladanyi@1426
|
266 |
/// Edge -> OutEdgeIt conversion
|
deba@1136
|
267 |
|
deba@1470
|
268 |
/// Sets the iterator to the value of the trivial iterator.
|
deba@1470
|
269 |
/// This feature necessitates that each time we
|
ladanyi@1426
|
270 |
/// iterate the edge-set, the iteration order is the same.
|
deba@2111
|
271 |
OutEdgeIt(const Graph&, const Edge&) { }
|
ladanyi@1426
|
272 |
///Next outgoing edge
|
ladanyi@1426
|
273 |
|
ladanyi@1426
|
274 |
/// Assign the iterator to the next
|
ladanyi@1426
|
275 |
/// outgoing edge of the corresponding node.
|
ladanyi@1426
|
276 |
OutEdgeIt& operator++() { return *this; }
|
deba@1136
|
277 |
};
|
deba@1136
|
278 |
|
deba@1136
|
279 |
/// This iterator goes trough the incoming edges of a node.
|
deba@1136
|
280 |
|
deba@1136
|
281 |
/// This iterator goes trough the \e incoming edges of a certain node
|
deba@1136
|
282 |
/// of a graph.
|
deba@1136
|
283 |
/// Its usage is quite simple, for example you can count the number
|
deba@1136
|
284 |
/// of outgoing edges of a node \c n
|
deba@1136
|
285 |
/// in graph \c g of type \c Graph as follows.
|
alpar@1946
|
286 |
///\code
|
deba@1136
|
287 |
/// int count=0;
|
deba@1136
|
288 |
/// for(Graph::InEdgeIt e(g, n); e!=INVALID; ++e) ++count;
|
alpar@1946
|
289 |
///\endcode
|
deba@1136
|
290 |
|
deba@1136
|
291 |
class InEdgeIt : public Edge {
|
deba@1136
|
292 |
public:
|
ladanyi@1426
|
293 |
/// Default constructor
|
deba@1136
|
294 |
|
ladanyi@1426
|
295 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
296 |
/// to an undefined value.
|
ladanyi@1426
|
297 |
InEdgeIt() { }
|
ladanyi@1426
|
298 |
/// Copy constructor.
|
deba@1136
|
299 |
|
ladanyi@1426
|
300 |
/// Copy constructor.
|
ladanyi@1426
|
301 |
///
|
ladanyi@1426
|
302 |
InEdgeIt(const InEdgeIt& e) : Edge(e) { }
|
ladanyi@1426
|
303 |
/// Initialize the iterator to be invalid.
|
deba@1136
|
304 |
|
ladanyi@1426
|
305 |
/// Initialize the iterator to be invalid.
|
ladanyi@1426
|
306 |
///
|
ladanyi@1426
|
307 |
InEdgeIt(Invalid) { }
|
ladanyi@1426
|
308 |
/// This constructor sets the iterator to first incoming edge.
|
deba@1136
|
309 |
|
ladanyi@1426
|
310 |
/// This constructor set the iterator to the first incoming edge of
|
ladanyi@1426
|
311 |
/// the node.
|
deba@2111
|
312 |
InEdgeIt(const Graph&, const Node&) { }
|
ladanyi@1426
|
313 |
/// Edge -> InEdgeIt conversion
|
deba@1136
|
314 |
|
ladanyi@1426
|
315 |
/// Sets the iterator to the value of the trivial iterator \c e.
|
ladanyi@1426
|
316 |
/// This feature necessitates that each time we
|
ladanyi@1426
|
317 |
/// iterate the edge-set, the iteration order is the same.
|
deba@2111
|
318 |
InEdgeIt(const Graph&, const Edge&) { }
|
ladanyi@1426
|
319 |
/// Next incoming edge
|
deba@1136
|
320 |
|
ladanyi@1426
|
321 |
/// Assign the iterator to the next inedge of the corresponding node.
|
ladanyi@1426
|
322 |
///
|
ladanyi@1426
|
323 |
InEdgeIt& operator++() { return *this; }
|
deba@1136
|
324 |
};
|
deba@1136
|
325 |
/// This iterator goes through each edge.
|
deba@1136
|
326 |
|
deba@1136
|
327 |
/// This iterator goes through each edge of a graph.
|
deba@1136
|
328 |
/// Its usage is quite simple, for example you can count the number
|
deba@1136
|
329 |
/// of edges in a graph \c g of type \c Graph as follows:
|
alpar@1946
|
330 |
///\code
|
deba@1136
|
331 |
/// int count=0;
|
deba@1136
|
332 |
/// for(Graph::EdgeIt e(g); e!=INVALID; ++e) ++count;
|
alpar@1946
|
333 |
///\endcode
|
deba@1136
|
334 |
class EdgeIt : public Edge {
|
deba@1136
|
335 |
public:
|
ladanyi@1426
|
336 |
/// Default constructor
|
deba@1136
|
337 |
|
ladanyi@1426
|
338 |
/// @warning The default constructor sets the iterator
|
ladanyi@1426
|
339 |
/// to an undefined value.
|
ladanyi@1426
|
340 |
EdgeIt() { }
|
ladanyi@1426
|
341 |
/// Copy constructor.
|
deba@1136
|
342 |
|
ladanyi@1426
|
343 |
/// Copy constructor.
|
ladanyi@1426
|
344 |
///
|
ladanyi@1426
|
345 |
EdgeIt(const EdgeIt& e) : Edge(e) { }
|
ladanyi@1426
|
346 |
/// Initialize the iterator to be invalid.
|
deba@1136
|
347 |
|
ladanyi@1426
|
348 |
/// Initialize the iterator to be invalid.
|
ladanyi@1426
|
349 |
///
|
ladanyi@1426
|
350 |
EdgeIt(Invalid) { }
|
ladanyi@1426
|
351 |
/// This constructor sets the iterator to the first edge.
|
deba@1136
|
352 |
|
ladanyi@1426
|
353 |
/// This constructor sets the iterator to the first edge of \c g.
|
ladanyi@1426
|
354 |
///@param g the graph
|
deba@2111
|
355 |
EdgeIt(const Graph& g) { ignore_unused_variable_warning(g); }
|
ladanyi@1426
|
356 |
/// Edge -> EdgeIt conversion
|
deba@1136
|
357 |
|
ladanyi@1426
|
358 |
/// Sets the iterator to the value of the trivial iterator \c e.
|
ladanyi@1426
|
359 |
/// This feature necessitates that each time we
|
ladanyi@1426
|
360 |
/// iterate the edge-set, the iteration order is the same.
|
deba@2111
|
361 |
EdgeIt(const Graph&, const Edge&) { }
|
ladanyi@1426
|
362 |
///Next edge
|
ladanyi@1426
|
363 |
|
ladanyi@1426
|
364 |
/// Assign the iterator to the next edge.
|
ladanyi@1426
|
365 |
EdgeIt& operator++() { return *this; }
|
deba@1136
|
366 |
};
|
deba@1136
|
367 |
///Gives back the target node of an edge.
|
deba@1136
|
368 |
|
deba@1136
|
369 |
///Gives back the target node of an edge.
|
deba@1136
|
370 |
///
|
deba@1136
|
371 |
Node target(Edge) const { return INVALID; }
|
deba@1136
|
372 |
///Gives back the source node of an edge.
|
deba@1136
|
373 |
|
deba@1136
|
374 |
///Gives back the source node of an edge.
|
deba@1136
|
375 |
///
|
deba@1136
|
376 |
Node source(Edge) const { return INVALID; }
|
deba@1563
|
377 |
|
deba@1563
|
378 |
void first(Node&) const {}
|
deba@1563
|
379 |
void next(Node&) const {}
|
deba@1563
|
380 |
|
deba@1563
|
381 |
void first(Edge&) const {}
|
deba@1563
|
382 |
void next(Edge&) const {}
|
deba@1563
|
383 |
|
deba@1563
|
384 |
|
deba@1563
|
385 |
void firstIn(Edge&, const Node&) const {}
|
deba@1563
|
386 |
void nextIn(Edge&) const {}
|
deba@1563
|
387 |
|
deba@1563
|
388 |
void firstOut(Edge&, const Node&) const {}
|
deba@1563
|
389 |
void nextOut(Edge&) const {}
|
deba@1563
|
390 |
|
deba@1563
|
391 |
/// \brief The base node of the iterator.
|
deba@1563
|
392 |
///
|
deba@1563
|
393 |
/// Gives back the base node of the iterator.
|
deba@1627
|
394 |
/// It is always the target of the pointed edge.
|
deba@1563
|
395 |
Node baseNode(const InEdgeIt&) const { return INVALID; }
|
deba@1563
|
396 |
|
deba@1563
|
397 |
/// \brief The running node of the iterator.
|
deba@1563
|
398 |
///
|
deba@1563
|
399 |
/// Gives back the running node of the iterator.
|
deba@1627
|
400 |
/// It is always the source of the pointed edge.
|
deba@1563
|
401 |
Node runningNode(const InEdgeIt&) const { return INVALID; }
|
deba@1563
|
402 |
|
deba@1563
|
403 |
/// \brief The base node of the iterator.
|
deba@1563
|
404 |
///
|
deba@1563
|
405 |
/// Gives back the base node of the iterator.
|
deba@1627
|
406 |
/// It is always the source of the pointed edge.
|
deba@1563
|
407 |
Node baseNode(const OutEdgeIt&) const { return INVALID; }
|
deba@1563
|
408 |
|
deba@1563
|
409 |
/// \brief The running node of the iterator.
|
deba@1563
|
410 |
///
|
deba@1563
|
411 |
/// Gives back the running node of the iterator.
|
deba@1627
|
412 |
/// It is always the target of the pointed edge.
|
deba@1563
|
413 |
Node runningNode(const OutEdgeIt&) const { return INVALID; }
|
deba@1136
|
414 |
|
deba@1627
|
415 |
/// \brief The opposite node on the given edge.
|
deba@1627
|
416 |
///
|
deba@1627
|
417 |
/// Gives back the opposite node on the given edge.
|
deba@1627
|
418 |
Node oppositeNode(const Node&, const Edge&) const { return INVALID; }
|
deba@1627
|
419 |
|
deba@1627
|
420 |
/// \brief Read write map of the nodes to type \c T.
|
deba@1627
|
421 |
///
|
deba@1136
|
422 |
/// ReadWrite map of the nodes to type \c T.
|
deba@1136
|
423 |
/// \sa Reference
|
deba@1136
|
424 |
/// \warning Making maps that can handle bool type (NodeMap<bool>)
|
deba@1136
|
425 |
/// needs some extra attention!
|
alpar@1630
|
426 |
/// \todo Wrong documentation
|
deba@1136
|
427 |
template<class T>
|
deba@1136
|
428 |
class NodeMap : public ReadWriteMap< Node, T >
|
deba@1136
|
429 |
{
|
deba@1136
|
430 |
public:
|
deba@1136
|
431 |
|
ladanyi@1426
|
432 |
///\e
|
deba@2111
|
433 |
NodeMap(const Graph&) { }
|
ladanyi@1426
|
434 |
///\e
|
deba@2111
|
435 |
NodeMap(const Graph&, T) { }
|
deba@1136
|
436 |
|
ladanyi@1426
|
437 |
///Copy constructor
|
ladanyi@1426
|
438 |
NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
|
ladanyi@1426
|
439 |
///Assignment operator
|
ladanyi@1426
|
440 |
NodeMap& operator=(const NodeMap&) { return *this; }
|
ladanyi@1426
|
441 |
// \todo fix this concept
|
deba@1136
|
442 |
};
|
deba@1136
|
443 |
|
deba@1627
|
444 |
/// \brief Read write map of the edges to type \c T.
|
deba@1627
|
445 |
///
|
deba@1627
|
446 |
/// Reference map of the edges to type \c T.
|
deba@1136
|
447 |
/// \sa Reference
|
deba@1136
|
448 |
/// \warning Making maps that can handle bool type (EdgeMap<bool>)
|
deba@1136
|
449 |
/// needs some extra attention!
|
alpar@1630
|
450 |
/// \todo Wrong documentation
|
deba@1136
|
451 |
template<class T>
|
deba@1136
|
452 |
class EdgeMap : public ReadWriteMap<Edge,T>
|
deba@1136
|
453 |
{
|
deba@1136
|
454 |
public:
|
deba@1136
|
455 |
|
ladanyi@1426
|
456 |
///\e
|
deba@2111
|
457 |
EdgeMap(const Graph&) { }
|
ladanyi@1426
|
458 |
///\e
|
deba@2111
|
459 |
EdgeMap(const Graph&, T) { }
|
ladanyi@1426
|
460 |
///Copy constructor
|
ladanyi@1426
|
461 |
EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
|
ladanyi@1426
|
462 |
///Assignment operator
|
ladanyi@1426
|
463 |
EdgeMap& operator=(const EdgeMap&) { return *this; }
|
ladanyi@1426
|
464 |
// \todo fix this concept
|
deba@1136
|
465 |
};
|
deba@1136
|
466 |
|
deba@2111
|
467 |
template <typename RGraph>
|
deba@2111
|
468 |
struct Constraints : public _Graph::Constraints<RGraph> {};
|
deba@1136
|
469 |
|
deba@1136
|
470 |
};
|
deba@1136
|
471 |
|
klao@959
|
472 |
// @}
|
klao@959
|
473 |
} //namespace concept
|
klao@959
|
474 |
} //namespace lemon
|
klao@959
|
475 |
|
klao@959
|
476 |
|
klao@959
|
477 |
|
klao@959
|
478 |
#endif // LEMON_CONCEPT_GRAPH_H
|