| ... | ... |
@@ -58,57 +58,63 @@ |
| 58 | 58 |
/// |
| 59 | 59 |
/// Copy constructor. |
| 60 | 60 |
GraphItem(const GraphItem &) {}
|
| 61 | 61 |
|
| 62 | 62 |
/// \brief Constructor for conversion from \c INVALID. |
| 63 | 63 |
/// |
| 64 | 64 |
/// Constructor for conversion from \c INVALID. |
| 65 | 65 |
/// It initializes the item to be invalid. |
| 66 | 66 |
/// \sa Invalid for more details. |
| 67 | 67 |
GraphItem(Invalid) {}
|
| 68 | 68 |
|
| 69 | 69 |
/// \brief Assignment operator. |
| 70 | 70 |
/// |
| 71 | 71 |
/// Assignment operator for the item. |
| 72 | 72 |
GraphItem& operator=(const GraphItem&) { return *this; }
|
| 73 | 73 |
|
| 74 |
/// \brief Assignment operator for INVALID. |
|
| 75 |
/// |
|
| 76 |
/// This operator makes the item invalid. |
|
| 77 |
GraphItem& operator=(Invalid) { return *this; }
|
|
| 78 |
|
|
| 74 | 79 |
/// \brief Equality operator. |
| 75 | 80 |
/// |
| 76 | 81 |
/// Equality operator. |
| 77 | 82 |
bool operator==(const GraphItem&) const { return false; }
|
| 78 | 83 |
|
| 79 | 84 |
/// \brief Inequality operator. |
| 80 | 85 |
/// |
| 81 | 86 |
/// Inequality operator. |
| 82 | 87 |
bool operator!=(const GraphItem&) const { return false; }
|
| 83 | 88 |
|
| 84 | 89 |
/// \brief Ordering operator. |
| 85 | 90 |
/// |
| 86 | 91 |
/// This operator defines an ordering of the items. |
| 87 | 92 |
/// It makes possible to use graph item types as key types in |
| 88 | 93 |
/// associative containers (e.g. \c std::map). |
| 89 | 94 |
/// |
| 90 | 95 |
/// \note This operator only have to define some strict ordering of |
| 91 | 96 |
/// the items; this order has nothing to do with the iteration |
| 92 | 97 |
/// ordering of the items. |
| 93 | 98 |
bool operator<(const GraphItem&) const { return false; }
|
| 94 | 99 |
|
| 95 | 100 |
template<typename _GraphItem> |
| 96 | 101 |
struct Constraints {
|
| 97 | 102 |
void constraints() {
|
| 98 | 103 |
_GraphItem i1; |
| 104 |
i1=INVALID; |
|
| 99 | 105 |
_GraphItem i2 = i1; |
| 100 | 106 |
_GraphItem i3 = INVALID; |
| 101 | 107 |
|
| 102 | 108 |
i1 = i2 = i3; |
| 103 | 109 |
|
| 104 | 110 |
bool b; |
| 105 | 111 |
b = (ia == ib) && (ia != ib); |
| 106 | 112 |
b = (ia == INVALID) && (ib != INVALID); |
| 107 | 113 |
b = (ia < ib); |
| 108 | 114 |
} |
| 109 | 115 |
|
| 110 | 116 |
const _GraphItem &ia; |
| 111 | 117 |
const _GraphItem &ib; |
| 112 | 118 |
}; |
| 113 | 119 |
}; |
| 114 | 120 |
|
| ... | ... |
@@ -208,40 +214,33 @@ |
| 208 | 214 |
/// Copy constructor. |
| 209 | 215 |
Edge(const Edge &) : Parent() {}
|
| 210 | 216 |
|
| 211 | 217 |
/// \brief Constructor for conversion from \c INVALID. |
| 212 | 218 |
/// |
| 213 | 219 |
/// Constructor for conversion from \c INVALID. |
| 214 | 220 |
/// It initializes the item to be invalid. |
| 215 | 221 |
/// \sa Invalid for more details. |
| 216 | 222 |
Edge(Invalid) {}
|
| 217 | 223 |
|
| 218 | 224 |
/// \brief Constructor for conversion from an arc. |
| 219 | 225 |
/// |
| 220 | 226 |
/// Constructor for conversion from an arc. |
| 221 | 227 |
/// Besides the core graph item functionality each arc should |
| 222 | 228 |
/// be convertible to the represented edge. |
| 223 | 229 |
Edge(const Arc&) {}
|
| 224 |
|
|
| 225 |
/// \brief Assign an arc to an edge. |
|
| 226 |
/// |
|
| 227 |
/// This function assigns an arc to an edge. |
|
| 228 |
/// Besides the core graph item functionality each arc should |
|
| 229 |
/// be convertible to the represented edge. |
|
| 230 |
Edge& operator=(const Arc&) { return *this; }
|
|
| 231 |
}; |
|
| 230 |
}; |
|
| 232 | 231 |
|
| 233 | 232 |
/// \brief Return one end node of an edge. |
| 234 | 233 |
/// |
| 235 | 234 |
/// This function returns one end node of an edge. |
| 236 | 235 |
Node u(const Edge&) const { return INVALID; }
|
| 237 | 236 |
|
| 238 | 237 |
/// \brief Return the other end node of an edge. |
| 239 | 238 |
/// |
| 240 | 239 |
/// This function returns the other end node of an edge. |
| 241 | 240 |
Node v(const Edge&) const { return INVALID; }
|
| 242 | 241 |
|
| 243 | 242 |
/// \brief Return a directed arc related to an edge. |
| 244 | 243 |
/// |
| 245 | 244 |
/// This function returns a directed arc from its direction and the |
| 246 | 245 |
/// represented edge. |
| 247 | 246 |
Arc direct(const Edge&, bool) const { return INVALID; }
|
| ... | ... |
@@ -340,36 +339,38 @@ |
| 340 | 339 |
/// maximum node id. |
| 341 | 340 |
int maxNodeId() const { return -1; }
|
| 342 | 341 |
|
| 343 | 342 |
/// \brief Return an integer greater or equal to the maximum |
| 344 | 343 |
/// arc id. |
| 345 | 344 |
/// |
| 346 | 345 |
/// This function returns an integer greater or equal to the |
| 347 | 346 |
/// maximum arc id. |
| 348 | 347 |
int maxArcId() const { return -1; }
|
| 349 | 348 |
|
| 350 | 349 |
template <typename _Digraph> |
| 351 | 350 |
struct Constraints {
|
| 352 | 351 |
|
| 353 | 352 |
void constraints() {
|
| 354 | 353 |
checkConcept<Base, _Digraph >(); |
| 355 | 354 |
typename _Digraph::Node node; |
| 355 |
node=INVALID; |
|
| 356 | 356 |
int nid = digraph.id(node); |
| 357 | 357 |
nid = digraph.id(node); |
| 358 | 358 |
node = digraph.nodeFromId(nid); |
| 359 | 359 |
typename _Digraph::Arc arc; |
| 360 |
arc=INVALID; |
|
| 360 | 361 |
int eid = digraph.id(arc); |
| 361 | 362 |
eid = digraph.id(arc); |
| 362 | 363 |
arc = digraph.arcFromId(eid); |
| 363 | 364 |
|
| 364 | 365 |
nid = digraph.maxNodeId(); |
| 365 | 366 |
ignore_unused_variable_warning(nid); |
| 366 | 367 |
eid = digraph.maxArcId(); |
| 367 | 368 |
ignore_unused_variable_warning(eid); |
| 368 | 369 |
} |
| 369 | 370 |
|
| 370 | 371 |
const _Digraph& digraph; |
| 371 | 372 |
}; |
| 372 | 373 |
}; |
| 373 | 374 |
|
| 374 | 375 |
/// \brief Skeleton class for \e idable undirected graphs. |
| 375 | 376 |
/// |
0 comments (0 inline)