| ... |
... |
@@ -110,16 +110,17 @@
|
| 110 |
110 |
bool b;
|
| 111 |
111 |
b = (ia == ib) && (ia != ib);
|
| 112 |
112 |
b = (ia == INVALID) && (ib != INVALID);
|
| 113 |
113 |
b = (ia < ib);
|
| 114 |
114 |
}
|
| 115 |
115 |
|
| 116 |
116 |
const _GraphItem &ia;
|
| 117 |
117 |
const _GraphItem &ib;
|
|
118 |
Constraints() {}
|
| 118 |
119 |
};
|
| 119 |
120 |
};
|
| 120 |
121 |
|
| 121 |
122 |
/// \brief Base skeleton class for directed graphs.
|
| 122 |
123 |
///
|
| 123 |
124 |
/// This class describes the base interface of directed graph types.
|
| 124 |
125 |
/// All digraph %concepts have to conform to this class.
|
| 125 |
126 |
/// It just provides types for nodes and arcs and functions
|
| ... |
... |
@@ -169,16 +170,17 @@
|
| 169 |
170 |
Arc e(INVALID);
|
| 170 |
171 |
n = digraph.source(e);
|
| 171 |
172 |
n = digraph.target(e);
|
| 172 |
173 |
n = digraph.oppositeNode(n, e);
|
| 173 |
174 |
}
|
| 174 |
175 |
}
|
| 175 |
176 |
|
| 176 |
177 |
const _Digraph& digraph;
|
|
178 |
Constraints() {}
|
| 177 |
179 |
};
|
| 178 |
180 |
};
|
| 179 |
181 |
|
| 180 |
182 |
/// \brief Base skeleton class for undirected graphs.
|
| 181 |
183 |
///
|
| 182 |
184 |
/// This class describes the base interface of undirected graph types.
|
| 183 |
185 |
/// All graph %concepts have to conform to this class.
|
| 184 |
186 |
/// It extends the interface of \ref BaseDigraphComponent with an
|
| ... |
... |
@@ -285,16 +287,17 @@
|
| 285 |
287 |
e = graph.oppositeArc(e);
|
| 286 |
288 |
ue = e;
|
| 287 |
289 |
bool d = graph.direction(e);
|
| 288 |
290 |
ignore_unused_variable_warning(d);
|
| 289 |
291 |
}
|
| 290 |
292 |
}
|
| 291 |
293 |
|
| 292 |
294 |
const _Graph& graph;
|
|
295 |
Constraints() {}
|
| 293 |
296 |
};
|
| 294 |
297 |
|
| 295 |
298 |
};
|
| 296 |
299 |
|
| 297 |
300 |
/// \brief Skeleton class for \e idable directed graphs.
|
| 298 |
301 |
///
|
| 299 |
302 |
/// This class describes the interface of \e idable directed graphs.
|
| 300 |
303 |
/// It extends \ref BaseDigraphComponent with the core ID functions.
|
| ... |
... |
@@ -364,16 +367,17 @@
|
| 364 |
367 |
|
| 365 |
368 |
nid = digraph.maxNodeId();
|
| 366 |
369 |
ignore_unused_variable_warning(nid);
|
| 367 |
370 |
eid = digraph.maxArcId();
|
| 368 |
371 |
ignore_unused_variable_warning(eid);
|
| 369 |
372 |
}
|
| 370 |
373 |
|
| 371 |
374 |
const _Digraph& digraph;
|
|
375 |
Constraints() {}
|
| 372 |
376 |
};
|
| 373 |
377 |
};
|
| 374 |
378 |
|
| 375 |
379 |
/// \brief Skeleton class for \e idable undirected graphs.
|
| 376 |
380 |
///
|
| 377 |
381 |
/// This class describes the interface of \e idable undirected
|
| 378 |
382 |
/// graphs. It extends \ref IDableDigraphComponent with the core ID
|
| 379 |
383 |
/// functions of undirected graphs.
|
| ... |
... |
@@ -416,16 +420,17 @@
|
| 416 |
420 |
int ueid = graph.id(edge);
|
| 417 |
421 |
ueid = graph.id(edge);
|
| 418 |
422 |
edge = graph.edgeFromId(ueid);
|
| 419 |
423 |
ueid = graph.maxEdgeId();
|
| 420 |
424 |
ignore_unused_variable_warning(ueid);
|
| 421 |
425 |
}
|
| 422 |
426 |
|
| 423 |
427 |
const _Graph& graph;
|
|
428 |
Constraints() {}
|
| 424 |
429 |
};
|
| 425 |
430 |
};
|
| 426 |
431 |
|
| 427 |
432 |
/// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
|
| 428 |
433 |
///
|
| 429 |
434 |
/// This class describes the concept of \c NodeIt, \c ArcIt and
|
| 430 |
435 |
/// \c EdgeIt subtypes of digraph and graph types.
|
| 431 |
436 |
template <typename GR, typename Item>
|
| ... |
... |
@@ -493,16 +498,17 @@
|
| 493 |
498 |
it2 = ++it1;
|
| 494 |
499 |
++it2 = it1;
|
| 495 |
500 |
++(++it1);
|
| 496 |
501 |
|
| 497 |
502 |
Item bi = it1;
|
| 498 |
503 |
bi = it2;
|
| 499 |
504 |
}
|
| 500 |
505 |
const GR& g;
|
|
506 |
Constraints() {}
|
| 501 |
507 |
};
|
| 502 |
508 |
};
|
| 503 |
509 |
|
| 504 |
510 |
/// \brief Concept class for \c InArcIt, \c OutArcIt and
|
| 505 |
511 |
/// \c IncEdgeIt types.
|
| 506 |
512 |
///
|
| 507 |
513 |
/// This class describes the concept of \c InArcIt, \c OutArcIt
|
| 508 |
514 |
/// and \c IncEdgeIt subtypes of digraph and graph types.
|
| ... |
... |
@@ -581,16 +587,17 @@
|
| 581 |
587 |
it2 = ++it1;
|
| 582 |
588 |
++it2 = it1;
|
| 583 |
589 |
++(++it1);
|
| 584 |
590 |
Item e = it1;
|
| 585 |
591 |
e = it2;
|
| 586 |
592 |
}
|
| 587 |
593 |
const Base& node;
|
| 588 |
594 |
const GR& graph;
|
|
595 |
Constraints() {}
|
| 589 |
596 |
};
|
| 590 |
597 |
};
|
| 591 |
598 |
|
| 592 |
599 |
/// \brief Skeleton class for iterable directed graphs.
|
| 593 |
600 |
///
|
| 594 |
601 |
/// This class describes the interface of iterable directed
|
| 595 |
602 |
/// graphs. It extends \ref BaseDigraphComponent with the core
|
| 596 |
603 |
/// iterable interface.
|
| ... |
... |
@@ -757,16 +764,17 @@
|
| 757 |
764 |
n = digraph.runningNode(iait);
|
| 758 |
765 |
n = digraph.baseNode(oait);
|
| 759 |
766 |
n = digraph.runningNode(oait);
|
| 760 |
767 |
ignore_unused_variable_warning(n);
|
| 761 |
768 |
}
|
| 762 |
769 |
}
|
| 763 |
770 |
|
| 764 |
771 |
const _Digraph& digraph;
|
|
772 |
Constraints() {}
|
| 765 |
773 |
};
|
| 766 |
774 |
};
|
| 767 |
775 |
|
| 768 |
776 |
/// \brief Skeleton class for iterable undirected graphs.
|
| 769 |
777 |
///
|
| 770 |
778 |
/// This class describes the interface of iterable undirected
|
| 771 |
779 |
/// graphs. It extends \ref IterableDigraphComponent with the core
|
| 772 |
780 |
/// iterable interface of undirected graphs.
|
| ... |
... |
@@ -881,16 +889,17 @@
|
| 881 |
889 |
typename _Graph::Node n;
|
| 882 |
890 |
const typename _Graph::IncEdgeIt ieit(INVALID);
|
| 883 |
891 |
n = graph.baseNode(ieit);
|
| 884 |
892 |
n = graph.runningNode(ieit);
|
| 885 |
893 |
}
|
| 886 |
894 |
}
|
| 887 |
895 |
|
| 888 |
896 |
const _Graph& graph;
|
|
897 |
Constraints() {}
|
| 889 |
898 |
};
|
| 890 |
899 |
};
|
| 891 |
900 |
|
| 892 |
901 |
/// \brief Skeleton class for alterable directed graphs.
|
| 893 |
902 |
///
|
| 894 |
903 |
/// This class describes the interface of alterable directed
|
| 895 |
904 |
/// graphs. It extends \ref BaseDigraphComponent with the alteration
|
| 896 |
905 |
/// notifier interface. It implements
|
| ... |
... |
@@ -938,16 +947,17 @@
|
| 938 |
947 |
typename _Digraph::ArcNotifier& en
|
| 939 |
948 |
= digraph.notifier(typename _Digraph::Arc());
|
| 940 |
949 |
|
| 941 |
950 |
ignore_unused_variable_warning(nn);
|
| 942 |
951 |
ignore_unused_variable_warning(en);
|
| 943 |
952 |
}
|
| 944 |
953 |
|
| 945 |
954 |
const _Digraph& digraph;
|
|
955 |
Constraints() {}
|
| 946 |
956 |
};
|
| 947 |
957 |
};
|
| 948 |
958 |
|
| 949 |
959 |
/// \brief Skeleton class for alterable undirected graphs.
|
| 950 |
960 |
///
|
| 951 |
961 |
/// This class describes the interface of alterable undirected
|
| 952 |
962 |
/// graphs. It extends \ref AlterableDigraphComponent with the alteration
|
| 953 |
963 |
/// notifier interface of undirected graphs. It implements
|
| ... |
... |
@@ -979,16 +989,17 @@
|
| 979 |
989 |
void constraints() {
|
| 980 |
990 |
checkConcept<AlterableDigraphComponent<Base>, _Graph>();
|
| 981 |
991 |
typename _Graph::EdgeNotifier& uen
|
| 982 |
992 |
= graph.notifier(typename _Graph::Edge());
|
| 983 |
993 |
ignore_unused_variable_warning(uen);
|
| 984 |
994 |
}
|
| 985 |
995 |
|
| 986 |
996 |
const _Graph& graph;
|
|
997 |
Constraints() {}
|
| 987 |
998 |
};
|
| 988 |
999 |
};
|
| 989 |
1000 |
|
| 990 |
1001 |
/// \brief Concept class for standard graph maps.
|
| 991 |
1002 |
///
|
| 992 |
1003 |
/// This class describes the concept of standard graph maps, i.e.
|
| 993 |
1004 |
/// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and
|
| 994 |
1005 |
/// graph types, which can be used for associating data to graph items.
|
| ... |
... |
@@ -1056,16 +1067,17 @@
|
| 1056 |
1067 |
ignore_unused_variable_warning(m1);
|
| 1057 |
1068 |
ignore_unused_variable_warning(m2);
|
| 1058 |
1069 |
// ignore_unused_variable_warning(m3);
|
| 1059 |
1070 |
}
|
| 1060 |
1071 |
|
| 1061 |
1072 |
const _Map &m;
|
| 1062 |
1073 |
const GR &g;
|
| 1063 |
1074 |
const typename GraphMap::Value &t;
|
|
1075 |
Constraints() {}
|
| 1064 |
1076 |
};
|
| 1065 |
1077 |
|
| 1066 |
1078 |
};
|
| 1067 |
1079 |
|
| 1068 |
1080 |
/// \brief Skeleton class for mappable directed graphs.
|
| 1069 |
1081 |
///
|
| 1070 |
1082 |
/// This class describes the interface of mappable directed graphs.
|
| 1071 |
1083 |
/// It extends \ref BaseDigraphComponent with the standard digraph
|
| ... |
... |
@@ -1194,16 +1206,17 @@
|
| 1194 |
1206 |
} { // Dummy map test
|
| 1195 |
1207 |
typedef typename _Digraph::template ArcMap<Dummy> DummyArcMap;
|
| 1196 |
1208 |
checkConcept<GraphMap<_Digraph, typename _Digraph::Arc, Dummy>,
|
| 1197 |
1209 |
DummyArcMap >();
|
| 1198 |
1210 |
}
|
| 1199 |
1211 |
}
|
| 1200 |
1212 |
|
| 1201 |
1213 |
const _Digraph& digraph;
|
|
1214 |
Constraints() {}
|
| 1202 |
1215 |
};
|
| 1203 |
1216 |
};
|
| 1204 |
1217 |
|
| 1205 |
1218 |
/// \brief Skeleton class for mappable undirected graphs.
|
| 1206 |
1219 |
///
|
| 1207 |
1220 |
/// This class describes the interface of mappable undirected graphs.
|
| 1208 |
1221 |
/// It extends \ref MappableDigraphComponent with the standard graph
|
| 1209 |
1222 |
/// map class for edges (\c EdgeMap).
|
| ... |
... |
@@ -1279,16 +1292,17 @@
|
| 1279 |
1292 |
} { // Dummy map test
|
| 1280 |
1293 |
typedef typename _Graph::template EdgeMap<Dummy> DummyEdgeMap;
|
| 1281 |
1294 |
checkConcept<GraphMap<_Graph, typename _Graph::Edge, Dummy>,
|
| 1282 |
1295 |
DummyEdgeMap >();
|
| 1283 |
1296 |
}
|
| 1284 |
1297 |
}
|
| 1285 |
1298 |
|
| 1286 |
1299 |
const _Graph& graph;
|
|
1300 |
Constraints() {}
|
| 1287 |
1301 |
};
|
| 1288 |
1302 |
};
|
| 1289 |
1303 |
|
| 1290 |
1304 |
/// \brief Skeleton class for extendable directed graphs.
|
| 1291 |
1305 |
///
|
| 1292 |
1306 |
/// This class describes the interface of extendable directed graphs.
|
| 1293 |
1307 |
/// It extends \ref BaseDigraphComponent with functions for adding
|
| 1294 |
1308 |
/// nodes and arcs to the digraph.
|
| ... |
... |
@@ -1323,16 +1337,17 @@
|
| 1323 |
1337 |
typename _Digraph::Node node_a, node_b;
|
| 1324 |
1338 |
node_a = digraph.addNode();
|
| 1325 |
1339 |
node_b = digraph.addNode();
|
| 1326 |
1340 |
typename _Digraph::Arc arc;
|
| 1327 |
1341 |
arc = digraph.addArc(node_a, node_b);
|
| 1328 |
1342 |
}
|
| 1329 |
1343 |
|
| 1330 |
1344 |
_Digraph& digraph;
|
|
1345 |
Constraints() {}
|
| 1331 |
1346 |
};
|
| 1332 |
1347 |
};
|
| 1333 |
1348 |
|
| 1334 |
1349 |
/// \brief Skeleton class for extendable undirected graphs.
|
| 1335 |
1350 |
///
|
| 1336 |
1351 |
/// This class describes the interface of extendable undirected graphs.
|
| 1337 |
1352 |
/// It extends \ref BaseGraphComponent with functions for adding
|
| 1338 |
1353 |
/// nodes and edges to the graph.
|
| ... |
... |
@@ -1367,16 +1382,17 @@
|
| 1367 |
1382 |
typename _Graph::Node node_a, node_b;
|
| 1368 |
1383 |
node_a = graph.addNode();
|
| 1369 |
1384 |
node_b = graph.addNode();
|
| 1370 |
1385 |
typename _Graph::Edge edge;
|
| 1371 |
1386 |
edge = graph.addEdge(node_a, node_b);
|
| 1372 |
1387 |
}
|
| 1373 |
1388 |
|
| 1374 |
1389 |
_Graph& graph;
|
|
1390 |
Constraints() {}
|
| 1375 |
1391 |
};
|
| 1376 |
1392 |
};
|
| 1377 |
1393 |
|
| 1378 |
1394 |
/// \brief Skeleton class for erasable directed graphs.
|
| 1379 |
1395 |
///
|
| 1380 |
1396 |
/// This class describes the interface of erasable directed graphs.
|
| 1381 |
1397 |
/// It extends \ref BaseDigraphComponent with functions for removing
|
| 1382 |
1398 |
/// nodes and arcs from the digraph.
|
| ... |
... |
@@ -1406,16 +1422,17 @@
|
| 1406 |
1422 |
checkConcept<Base, _Digraph>();
|
| 1407 |
1423 |
const typename _Digraph::Node node(INVALID);
|
| 1408 |
1424 |
digraph.erase(node);
|
| 1409 |
1425 |
const typename _Digraph::Arc arc(INVALID);
|
| 1410 |
1426 |
digraph.erase(arc);
|
| 1411 |
1427 |
}
|
| 1412 |
1428 |
|
| 1413 |
1429 |
_Digraph& digraph;
|
|
1430 |
Constraints() {}
|
| 1414 |
1431 |
};
|
| 1415 |
1432 |
};
|
| 1416 |
1433 |
|
| 1417 |
1434 |
/// \brief Skeleton class for erasable undirected graphs.
|
| 1418 |
1435 |
///
|
| 1419 |
1436 |
/// This class describes the interface of erasable undirected graphs.
|
| 1420 |
1437 |
/// It extends \ref BaseGraphComponent with functions for removing
|
| 1421 |
1438 |
/// nodes and edges from the graph.
|
| ... |
... |
@@ -1445,16 +1462,17 @@
|
| 1445 |
1462 |
checkConcept<Base, _Graph>();
|
| 1446 |
1463 |
const typename _Graph::Node node(INVALID);
|
| 1447 |
1464 |
graph.erase(node);
|
| 1448 |
1465 |
const typename _Graph::Edge edge(INVALID);
|
| 1449 |
1466 |
graph.erase(edge);
|
| 1450 |
1467 |
}
|
| 1451 |
1468 |
|
| 1452 |
1469 |
_Graph& graph;
|
|
1470 |
Constraints() {}
|
| 1453 |
1471 |
};
|
| 1454 |
1472 |
};
|
| 1455 |
1473 |
|
| 1456 |
1474 |
/// \brief Skeleton class for clearable directed graphs.
|
| 1457 |
1475 |
///
|
| 1458 |
1476 |
/// This class describes the interface of clearable directed graphs.
|
| 1459 |
1477 |
/// It extends \ref BaseDigraphComponent with a function for clearing
|
| 1460 |
1478 |
/// the digraph.
|
| ... |
... |
@@ -1473,16 +1491,17 @@
|
| 1473 |
1491 |
template <typename _Digraph>
|
| 1474 |
1492 |
struct Constraints {
|
| 1475 |
1493 |
void constraints() {
|
| 1476 |
1494 |
checkConcept<Base, _Digraph>();
|
| 1477 |
1495 |
digraph.clear();
|
| 1478 |
1496 |
}
|
| 1479 |
1497 |
|
| 1480 |
1498 |
_Digraph& digraph;
|
|
1499 |
Constraints() {}
|
| 1481 |
1500 |
};
|
| 1482 |
1501 |
};
|
| 1483 |
1502 |
|
| 1484 |
1503 |
/// \brief Skeleton class for clearable undirected graphs.
|
| 1485 |
1504 |
///
|
| 1486 |
1505 |
/// This class describes the interface of clearable undirected graphs.
|
| 1487 |
1506 |
/// It extends \ref BaseGraphComponent with a function for clearing
|
| 1488 |
1507 |
/// the graph.
|
| ... |
... |
@@ -1501,16 +1520,17 @@
|
| 1501 |
1520 |
template <typename _Graph>
|
| 1502 |
1521 |
struct Constraints {
|
| 1503 |
1522 |
void constraints() {
|
| 1504 |
1523 |
checkConcept<Base, _Graph>();
|
| 1505 |
1524 |
graph.clear();
|
| 1506 |
1525 |
}
|
| 1507 |
1526 |
|
| 1508 |
1527 |
_Graph& graph;
|
|
1528 |
Constraints() {}
|
| 1509 |
1529 |
};
|
| 1510 |
1530 |
};
|
| 1511 |
1531 |
|
| 1512 |
1532 |
}
|
| 1513 |
1533 |
|
| 1514 |
1534 |
}
|
| 1515 |
1535 |
|
| 1516 |
1536 |
#endif
|