... | ... |
@@ -465,32 +465,29 @@ |
465 | 465 |
while (i != INVALID && (!(*_arc_filter)[i] |
466 | 466 |
|| !(*_node_filter)[Parent::source(i)])) |
467 | 467 |
Parent::nextIn(i); |
468 | 468 |
} |
469 | 469 |
|
470 | 470 |
void nextOut(Arc& i) const { |
471 | 471 |
Parent::nextOut(i); |
472 | 472 |
while (i != INVALID && (!(*_arc_filter)[i] |
473 | 473 |
|| !(*_node_filter)[Parent::target(i)])) |
474 | 474 |
Parent::nextOut(i); |
475 | 475 |
} |
476 | 476 |
|
477 |
void hide(const Node& n) const { _node_filter->set(n, false); } |
|
478 |
void hide(const Arc& a) const { _arc_filter->set(a, false); } |
|
479 |
|
|
480 |
void unHide(const Node& n) const { _node_filter->set(n, true); } |
|
481 |
void unHide(const Arc& a) const { _arc_filter->set(a, true); } |
|
482 |
|
|
483 |
bool hidden(const Node& n) const { return !(*_node_filter)[n]; } |
|
484 |
bool hidden(const Arc& a) const { return !(*_arc_filter)[a]; } |
|
477 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); } |
|
478 |
void status(const Arc& a, bool v) const { _arc_filter->set(a, v); } |
|
479 |
|
|
480 |
bool status(const Node& n) const { return (*_node_filter)[n]; } |
|
481 |
bool status(const Arc& a) const { return (*_arc_filter)[a]; } |
|
485 | 482 |
|
486 | 483 |
typedef False NodeNumTag; |
487 | 484 |
typedef False ArcNumTag; |
488 | 485 |
|
489 | 486 |
typedef FindArcTagIndicator<Digraph> FindArcTag; |
490 | 487 |
Arc findArc(const Node& source, const Node& target, |
491 | 488 |
const Arc& prev = INVALID) const { |
492 | 489 |
if (!(*_node_filter)[source] || !(*_node_filter)[target]) { |
493 | 490 |
return INVALID; |
494 | 491 |
} |
495 | 492 |
Arc arc = Parent::findArc(source, target, prev); |
496 | 493 |
while (arc != INVALID && !(*_arc_filter)[arc]) { |
... | ... |
@@ -608,32 +605,29 @@ |
608 | 605 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::next(i); |
609 | 606 |
} |
610 | 607 |
void nextIn(Arc& i) const { |
611 | 608 |
Parent::nextIn(i); |
612 | 609 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextIn(i); |
613 | 610 |
} |
614 | 611 |
|
615 | 612 |
void nextOut(Arc& i) const { |
616 | 613 |
Parent::nextOut(i); |
617 | 614 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextOut(i); |
618 | 615 |
} |
619 | 616 |
|
620 |
void hide(const Node& n) const { _node_filter->set(n, false); } |
|
621 |
void hide(const Arc& e) const { _arc_filter->set(e, false); } |
|
622 |
|
|
623 |
void unHide(const Node& n) const { _node_filter->set(n, true); } |
|
624 |
void unHide(const Arc& e) const { _arc_filter->set(e, true); } |
|
625 |
|
|
626 |
bool hidden(const Node& n) const { return !(*_node_filter)[n]; } |
|
627 |
bool hidden(const Arc& e) const { return !(*_arc_filter)[e]; } |
|
617 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); } |
|
618 |
void status(const Arc& a, bool v) const { _arc_filter->set(a, v); } |
|
619 |
|
|
620 |
bool status(const Node& n) const { return (*_node_filter)[n]; } |
|
621 |
bool status(const Arc& a) const { return (*_arc_filter)[a]; } |
|
628 | 622 |
|
629 | 623 |
typedef False NodeNumTag; |
630 | 624 |
typedef False ArcNumTag; |
631 | 625 |
|
632 | 626 |
typedef FindArcTagIndicator<Digraph> FindArcTag; |
633 | 627 |
Arc findArc(const Node& source, const Node& target, |
634 | 628 |
const Arc& prev = INVALID) const { |
635 | 629 |
if (!(*_node_filter)[source] || !(*_node_filter)[target]) { |
636 | 630 |
return INVALID; |
637 | 631 |
} |
638 | 632 |
Arc arc = Parent::findArc(source, target, prev); |
639 | 633 |
while (arc != INVALID && !(*_arc_filter)[arc]) { |
... | ... |
@@ -765,63 +759,75 @@ |
765 | 759 |
|
766 | 760 |
/// \brief Constructor |
767 | 761 |
/// |
768 | 762 |
/// Creates a subdigraph for the given digraph with the |
769 | 763 |
/// given node and arc filter maps. |
770 | 764 |
SubDigraph(Digraph& digraph, NodeFilterMap& node_filter, |
771 | 765 |
ArcFilterMap& arc_filter) { |
772 | 766 |
setDigraph(digraph); |
773 | 767 |
setNodeFilterMap(node_filter); |
774 | 768 |
setArcFilterMap(arc_filter); |
775 | 769 |
} |
776 | 770 |
|
777 |
/// \brief |
|
771 |
/// \brief Sets the status of the given node |
|
778 | 772 |
/// |
779 |
/// This function hides the given node in the subdigraph, |
|
780 |
/// i.e. the iteration jumps over it. |
|
773 |
/// This function sets the status of the given node. |
|
781 | 774 |
/// It is done by simply setting the assigned value of \c n |
782 |
/// to be \c false in the node filter map. |
|
783 |
void hide(const Node& n) const { Parent::hide(n); } |
|
784 |
|
|
785 |
/// \brief Hides the given arc |
|
775 |
/// to \c v in the node filter map. |
|
776 |
void status(const Node& n, bool v) const { Parent::status(n, v); } |
|
777 |
|
|
778 |
/// \brief Sets the status of the given arc |
|
786 | 779 |
/// |
787 |
/// This function hides the given arc in the subdigraph, |
|
788 |
/// i.e. the iteration jumps over it. |
|
780 |
/// This function sets the status of the given arc. |
|
789 | 781 |
/// It is done by simply setting the assigned value of \c a |
790 |
/// to be \c false in the arc filter map. |
|
791 |
void hide(const Arc& a) const { Parent::hide(a); } |
|
792 |
|
|
793 |
/// \brief Shows the given node |
|
782 |
/// to \c v in the arc filter map. |
|
783 |
void status(const Arc& a, bool v) const { Parent::status(a, v); } |
|
784 |
|
|
785 |
/// \brief Returns the status of the given node |
|
794 | 786 |
/// |
795 |
/// This function shows the given node in the subdigraph. |
|
796 |
/// It is done by simply setting the assigned value of \c n |
|
797 |
/// to be \c true in the node filter map. |
|
798 |
void unHide(const Node& n) const { Parent::unHide(n); } |
|
799 |
|
|
800 |
/// \brief Shows the given arc |
|
787 |
/// This function returns the status of the given node. |
|
788 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
789 |
bool status(const Node& n) const { return Parent::status(n); } |
|
790 |
|
|
791 |
/// \brief Returns the status of the given arc |
|
801 | 792 |
/// |
802 |
/// This function shows the given arc in the subdigraph. |
|
803 |
/// It is done by simply setting the assigned value of \c a |
|
804 |
/// to be \c true in the arc filter map. |
|
805 |
void unHide(const Arc& a) const { Parent::unHide(a); } |
|
806 |
|
|
807 |
/// \brief Returns \c true if the given node is hidden. |
|
793 |
/// This function returns the status of the given arc. |
|
794 |
/// It is \c true if the given arc is enabled (i.e. not hidden). |
|
795 |
bool status(const Arc& a) const { return Parent::status(a); } |
|
796 |
|
|
797 |
/// \brief Disables the given node |
|
808 | 798 |
/// |
809 |
/// This function returns \c true if the given node is hidden. |
|
810 |
bool hidden(const Node& n) const { return Parent::hidden(n); } |
|
811 |
|
|
812 |
/// \brief Returns \c true if the given arc is hidden. |
|
799 |
/// This function disables the given node in the subdigraph, |
|
800 |
/// so the iteration jumps over it. |
|
801 |
/// It is the same as \ref status() "status(n, false)". |
|
802 |
void disable(const Node& n) const { Parent::status(n, false); } |
|
803 |
|
|
804 |
/// \brief Disables the given arc |
|
813 | 805 |
/// |
814 |
/// This function returns \c true if the given arc is hidden. |
|
815 |
bool hidden(const Arc& a) const { return Parent::hidden(a); } |
|
806 |
/// This function disables the given arc in the subdigraph, |
|
807 |
/// so the iteration jumps over it. |
|
808 |
/// It is the same as \ref status() "status(a, false)". |
|
809 |
void disable(const Arc& a) const { Parent::status(a, false); } |
|
810 |
|
|
811 |
/// \brief Enables the given node |
|
812 |
/// |
|
813 |
/// This function enables the given node in the subdigraph. |
|
814 |
/// It is the same as \ref status() "status(n, true)". |
|
815 |
void enable(const Node& n) const { Parent::status(n, true); } |
|
816 |
|
|
817 |
/// \brief Enables the given arc |
|
818 |
/// |
|
819 |
/// This function enables the given arc in the subdigraph. |
|
820 |
/// It is the same as \ref status() "status(a, true)". |
|
821 |
void enable(const Arc& a) const { Parent::status(a, true); } |
|
816 | 822 |
|
817 | 823 |
}; |
818 | 824 |
|
819 | 825 |
/// \brief Returns a read-only SubDigraph adaptor |
820 | 826 |
/// |
821 | 827 |
/// This function just returns a read-only \ref SubDigraph adaptor. |
822 | 828 |
/// \ingroup graph_adaptors |
823 | 829 |
/// \relates SubDigraph |
824 | 830 |
template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap> |
825 | 831 |
SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap> |
826 | 832 |
subDigraph(const Digraph& digraph, NodeFilterMap& nfm, ArcFilterMap& afm) { |
827 | 833 |
return SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap> |
... | ... |
@@ -961,32 +967,29 @@ |
961 | 967 |
|| !(*_node_filter_map)[Parent::target(i)])) |
962 | 968 |
Parent::nextOut(i); |
963 | 969 |
} |
964 | 970 |
|
965 | 971 |
void nextInc(Edge& i, bool& d) const { |
966 | 972 |
Parent::nextInc(i, d); |
967 | 973 |
while (i!=INVALID && (!(*_edge_filter_map)[i] |
968 | 974 |
|| !(*_node_filter_map)[Parent::u(i)] |
969 | 975 |
|| !(*_node_filter_map)[Parent::v(i)])) |
970 | 976 |
Parent::nextInc(i, d); |
971 | 977 |
} |
972 | 978 |
|
973 |
void hide(const Node& n) const { _node_filter_map->set(n, false); } |
|
974 |
void hide(const Edge& e) const { _edge_filter_map->set(e, false); } |
|
975 |
|
|
976 |
void unHide(const Node& n) const { _node_filter_map->set(n, true); } |
|
977 |
void unHide(const Edge& e) const { _edge_filter_map->set(e, true); } |
|
978 |
|
|
979 |
bool hidden(const Node& n) const { return !(*_node_filter_map)[n]; } |
|
980 |
bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; } |
|
979 |
void status(const Node& n, bool v) const { _node_filter_map->set(n, v); } |
|
980 |
void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); } |
|
981 |
|
|
982 |
bool status(const Node& n) const { return (*_node_filter_map)[n]; } |
|
983 |
bool status(const Edge& e) const { return (*_edge_filter_map)[e]; } |
|
981 | 984 |
|
982 | 985 |
typedef False NodeNumTag; |
983 | 986 |
typedef False ArcNumTag; |
984 | 987 |
typedef False EdgeNumTag; |
985 | 988 |
|
986 | 989 |
typedef FindArcTagIndicator<Graph> FindArcTag; |
987 | 990 |
Arc findArc(const Node& u, const Node& v, |
988 | 991 |
const Arc& prev = INVALID) const { |
989 | 992 |
if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) { |
990 | 993 |
return INVALID; |
991 | 994 |
} |
992 | 995 |
Arc arc = Parent::findArc(u, v, prev); |
... | ... |
@@ -1163,32 +1166,29 @@ |
1163 | 1166 |
while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextIn(i); |
1164 | 1167 |
} |
1165 | 1168 |
|
1166 | 1169 |
void nextOut(Arc& i) const { |
1167 | 1170 |
Parent::nextOut(i); |
1168 | 1171 |
while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextOut(i); |
1169 | 1172 |
} |
1170 | 1173 |
void nextInc(Edge& i, bool& d) const { |
1171 | 1174 |
Parent::nextInc(i, d); |
1172 | 1175 |
while (i!=INVALID && !(*_edge_filter_map)[i]) Parent::nextInc(i, d); |
1173 | 1176 |
} |
1174 | 1177 |
|
1175 |
void hide(const Node& n) const { _node_filter_map->set(n, false); } |
|
1176 |
void hide(const Edge& e) const { _edge_filter_map->set(e, false); } |
|
1177 |
|
|
1178 |
void unHide(const Node& n) const { _node_filter_map->set(n, true); } |
|
1179 |
void unHide(const Edge& e) const { _edge_filter_map->set(e, true); } |
|
1180 |
|
|
1181 |
bool hidden(const Node& n) const { return !(*_node_filter_map)[n]; } |
|
1182 |
bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; } |
|
1178 |
void status(const Node& n, bool v) const { _node_filter_map->set(n, v); } |
|
1179 |
void status(const Edge& e, bool v) const { _edge_filter_map->set(e, v); } |
|
1180 |
|
|
1181 |
bool status(const Node& n) const { return (*_node_filter_map)[n]; } |
|
1182 |
bool status(const Edge& e) const { return (*_edge_filter_map)[e]; } |
|
1183 | 1183 |
|
1184 | 1184 |
typedef False NodeNumTag; |
1185 | 1185 |
typedef False ArcNumTag; |
1186 | 1186 |
typedef False EdgeNumTag; |
1187 | 1187 |
|
1188 | 1188 |
typedef FindArcTagIndicator<Graph> FindArcTag; |
1189 | 1189 |
Arc findArc(const Node& u, const Node& v, |
1190 | 1190 |
const Arc& prev = INVALID) const { |
1191 | 1191 |
Arc arc = Parent::findArc(u, v, prev); |
1192 | 1192 |
while (arc != INVALID && !(*_edge_filter_map)[arc]) { |
1193 | 1193 |
arc = Parent::findArc(u, v, arc); |
1194 | 1194 |
} |
... | ... |
@@ -1354,63 +1354,76 @@ |
1354 | 1354 |
|
1355 | 1355 |
/// \brief Constructor |
1356 | 1356 |
/// |
1357 | 1357 |
/// Creates a subgraph for the given graph with the given node |
1358 | 1358 |
/// and edge filter maps. |
1359 | 1359 |
SubGraph(Graph& graph, NodeFilterMap& node_filter_map, |
1360 | 1360 |
EdgeFilterMap& edge_filter_map) { |
1361 | 1361 |
setGraph(graph); |
1362 | 1362 |
setNodeFilterMap(node_filter_map); |
1363 | 1363 |
setEdgeFilterMap(edge_filter_map); |
1364 | 1364 |
} |
1365 | 1365 |
|
1366 |
/// \brief |
|
1366 |
/// \brief Sets the status of the given node |
|
1367 | 1367 |
/// |
1368 |
/// This function hides the given node in the subgraph, |
|
1369 |
/// i.e. the iteration jumps over it. |
|
1368 |
/// This function sets the status of the given node. |
|
1370 | 1369 |
/// It is done by simply setting the assigned value of \c n |
1371 |
/// to be \c false in the node filter map. |
|
1372 |
void hide(const Node& n) const { Parent::hide(n); } |
|
1373 |
|
|
1374 |
/// \brief Hides the given edge |
|
1370 |
/// to \c v in the node filter map. |
|
1371 |
void status(const Node& n, bool v) const { Parent::status(n, v); } |
|
1372 |
|
|
1373 |
/// \brief Sets the status of the given edge |
|
1375 | 1374 |
/// |
1376 |
/// This function hides the given edge in the subgraph, |
|
1377 |
/// i.e. the iteration jumps over it. |
|
1375 |
/// This function sets the status of the given edge. |
|
1378 | 1376 |
/// It is done by simply setting the assigned value of \c e |
1379 |
/// to be \c false in the edge filter map. |
|
1380 |
void hide(const Edge& e) const { Parent::hide(e); } |
|
1381 |
|
|
1382 |
/// \brief Shows the given node |
|
1377 |
/// to \c v in the edge filter map. |
|
1378 |
void status(const Edge& e, bool v) const { Parent::status(e, v); } |
|
1379 |
|
|
1380 |
/// \brief Returns the status of the given node |
|
1383 | 1381 |
/// |
1384 |
/// This function shows the given node in the subgraph. |
|
1385 |
/// It is done by simply setting the assigned value of \c n |
|
1386 |
/// to be \c true in the node filter map. |
|
1387 |
void unHide(const Node& n) const { Parent::unHide(n); } |
|
1388 |
|
|
1389 |
/// \brief Shows the given edge |
|
1382 |
/// This function returns the status of the given node. |
|
1383 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
1384 |
bool status(const Node& n) const { return Parent::status(n); } |
|
1385 |
|
|
1386 |
/// \brief Returns the status of the given edge |
|
1390 | 1387 |
/// |
1391 |
/// This function shows the given edge in the subgraph. |
|
1392 |
/// It is done by simply setting the assigned value of \c e |
|
1393 |
/// to be \c true in the edge filter map. |
|
1394 |
void unHide(const Edge& e) const { Parent::unHide(e); } |
|
1395 |
|
|
1396 |
/// \brief Returns \c true if the given node is hidden. |
|
1388 |
/// This function returns the status of the given edge. |
|
1389 |
/// It is \c true if the given edge is enabled (i.e. not hidden). |
|
1390 |
bool status(const Edge& e) const { return Parent::status(e); } |
|
1391 |
|
|
1392 |
/// \brief Disables the given node |
|
1397 | 1393 |
/// |
1398 |
/// This function returns \c true if the given node is hidden. |
|
1399 |
bool hidden(const Node& n) const { return Parent::hidden(n); } |
|
1400 |
|
|
1401 |
/// \brief Returns \c true if the given edge is hidden. |
|
1394 |
/// This function disables the given node in the subdigraph, |
|
1395 |
/// so the iteration jumps over it. |
|
1396 |
/// It is the same as \ref status() "status(n, false)". |
|
1397 |
void disable(const Node& n) const { Parent::status(n, false); } |
|
1398 |
|
|
1399 |
/// \brief Disables the given edge |
|
1402 | 1400 |
/// |
1403 |
/// This function returns \c true if the given edge is hidden. |
|
1404 |
bool hidden(const Edge& e) const { return Parent::hidden(e); } |
|
1401 |
/// This function disables the given edge in the subgraph, |
|
1402 |
/// so the iteration jumps over it. |
|
1403 |
/// It is the same as \ref status() "status(e, false)". |
|
1404 |
void disable(const Edge& e) const { Parent::status(e, false); } |
|
1405 |
|
|
1406 |
/// \brief Enables the given node |
|
1407 |
/// |
|
1408 |
/// This function enables the given node in the subdigraph. |
|
1409 |
/// It is the same as \ref status() "status(n, true)". |
|
1410 |
void enable(const Node& n) const { Parent::status(n, true); } |
|
1411 |
|
|
1412 |
/// \brief Enables the given edge |
|
1413 |
/// |
|
1414 |
/// This function enables the given edge in the subgraph. |
|
1415 |
/// It is the same as \ref status() "status(e, true)". |
|
1416 |
void enable(const Edge& e) const { Parent::status(e, true); } |
|
1417 |
|
|
1405 | 1418 |
}; |
1406 | 1419 |
|
1407 | 1420 |
/// \brief Returns a read-only SubGraph adaptor |
1408 | 1421 |
/// |
1409 | 1422 |
/// This function just returns a read-only \ref SubGraph adaptor. |
1410 | 1423 |
/// \ingroup graph_adaptors |
1411 | 1424 |
/// \relates SubGraph |
1412 | 1425 |
template<typename Graph, typename NodeFilterMap, typename ArcFilterMap> |
1413 | 1426 |
SubGraph<const Graph, NodeFilterMap, ArcFilterMap> |
1414 | 1427 |
subGraph(const Graph& graph, NodeFilterMap& nfm, ArcFilterMap& efm) { |
1415 | 1428 |
return SubGraph<const Graph, NodeFilterMap, ArcFilterMap>(graph, nfm, efm); |
1416 | 1429 |
} |
... | ... |
@@ -1510,43 +1523,49 @@ |
1510 | 1523 |
/// given node filter map. |
1511 | 1524 |
#ifdef DOXYGEN |
1512 | 1525 |
FilterNodes(_Graph& graph, _NodeFilterMap& node_filter) : |
1513 | 1526 |
#else |
1514 | 1527 |
FilterNodes(Digraph& graph, NodeFilterMap& node_filter) : |
1515 | 1528 |
#endif |
1516 | 1529 |
Parent(), const_true_map(true) { |
1517 | 1530 |
Parent::setDigraph(graph); |
1518 | 1531 |
Parent::setNodeFilterMap(node_filter); |
1519 | 1532 |
Parent::setArcFilterMap(const_true_map); |
1520 | 1533 |
} |
1521 | 1534 |
|
1522 |
/// \brief |
|
1535 |
/// \brief Sets the status of the given node |
|
1523 | 1536 |
/// |
1524 |
/// This function hides the given node in the subgraph, |
|
1525 |
/// i.e. the iteration jumps over it. |
|
1537 |
/// This function sets the status of the given node. |
|
1526 | 1538 |
/// It is done by simply setting the assigned value of \c n |
1527 |
/// to be \c false in the node filter map. |
|
1528 |
void hide(const Node& n) const { Parent::hide(n); } |
|
1529 |
|
|
1530 |
/// \brief Shows the given node |
|
1539 |
/// to \c v in the node filter map. |
|
1540 |
void status(const Node& n, bool v) const { Parent::status(n, v); } |
|
1541 |
|
|
1542 |
/// \brief Returns the status of the given node |
|
1531 | 1543 |
/// |
1532 |
/// This function shows the given node in the subgraph. |
|
1533 |
/// It is done by simply setting the assigned value of \c n |
|
1534 |
/// to be \c true in the node filter map. |
|
1535 |
void unHide(const Node& n) const { Parent::unHide(n); } |
|
1536 |
|
|
1537 |
/// \brief Returns \c true if the given node is hidden. |
|
1544 |
/// This function returns the status of the given node. |
|
1545 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
1546 |
bool status(const Node& n) const { return Parent::status(n); } |
|
1547 |
|
|
1548 |
/// \brief Disables the given node |
|
1538 | 1549 |
/// |
1539 |
/// This function returns \c true if the given node is hidden. |
|
1540 |
bool hidden(const Node& n) const { return Parent::hidden(n); } |
|
1550 |
/// This function disables the given node, so the iteration |
|
1551 |
/// jumps over it. |
|
1552 |
/// It is the same as \ref status() "status(n, false)". |
|
1553 |
void disable(const Node& n) const { Parent::status(n, false); } |
|
1554 |
|
|
1555 |
/// \brief Enables the given node |
|
1556 |
/// |
|
1557 |
/// This function enables the given node. |
|
1558 |
/// It is the same as \ref status() "status(n, true)". |
|
1559 |
void enable(const Node& n) const { Parent::status(n, true); } |
|
1541 | 1560 |
|
1542 | 1561 |
}; |
1543 | 1562 |
|
1544 | 1563 |
template<typename _Graph, typename _NodeFilterMap, bool _checked> |
1545 | 1564 |
class FilterNodes<_Graph, _NodeFilterMap, _checked, |
1546 | 1565 |
typename enable_if<UndirectedTagIndicator<_Graph> >::type> |
1547 | 1566 |
: public SubGraph<_Graph, _NodeFilterMap, |
1548 | 1567 |
ConstMap<typename _Graph::Edge, bool>, _checked> { |
1549 | 1568 |
public: |
1550 | 1569 |
typedef _Graph Graph; |
1551 | 1570 |
typedef _NodeFilterMap NodeFilterMap; |
1552 | 1571 |
typedef SubGraph<Graph, NodeFilterMap, |
... | ... |
@@ -1560,27 +1579,28 @@ |
1560 | 1579 |
Parent::setEdgeFilterMap(const_true_map); |
1561 | 1580 |
} |
1562 | 1581 |
|
1563 | 1582 |
public: |
1564 | 1583 |
|
1565 | 1584 |
FilterNodes(Graph& _graph, NodeFilterMap& node_filter_map) : |
1566 | 1585 |
Parent(), const_true_map(true) { |
1567 | 1586 |
Parent::setGraph(_graph); |
1568 | 1587 |
Parent::setNodeFilterMap(node_filter_map); |
1569 | 1588 |
Parent::setEdgeFilterMap(const_true_map); |
1570 | 1589 |
} |
1571 | 1590 |
|
1572 |
void hide(const Node& n) const { Parent::hide(n); } |
|
1573 |
void unHide(const Node& n) const { Parent::unHide(n); } |
|
1574 |
|
|
1591 |
void status(const Node& n, bool v) const { Parent::status(n, v); } |
|
1592 |
bool status(const Node& n) const { return Parent::status(n); } |
|
1593 |
void disable(const Node& n) const { Parent::status(n, false); } |
|
1594 |
void enable(const Node& n) const { Parent::status(n, true); } |
|
1575 | 1595 |
|
1576 | 1596 |
}; |
1577 | 1597 |
|
1578 | 1598 |
|
1579 | 1599 |
/// \brief Returns a read-only FilterNodes adaptor |
1580 | 1600 |
/// |
1581 | 1601 |
/// This function just returns a read-only \ref FilterNodes adaptor. |
1582 | 1602 |
/// \ingroup graph_adaptors |
1583 | 1603 |
/// \relates FilterNodes |
1584 | 1604 |
template<typename Digraph, typename NodeFilterMap> |
1585 | 1605 |
FilterNodes<const Digraph, NodeFilterMap> |
1586 | 1606 |
filterNodes(const Digraph& digraph, NodeFilterMap& nfm) { |
... | ... |
@@ -1647,43 +1667,49 @@ |
1647 | 1667 |
|
1648 | 1668 |
/// \brief Constructor |
1649 | 1669 |
/// |
1650 | 1670 |
/// Creates a subdigraph for the given digraph with the given arc |
1651 | 1671 |
/// filter map. |
1652 | 1672 |
FilterArcs(Digraph& digraph, ArcFilterMap& arc_filter) |
1653 | 1673 |
: Parent(), const_true_map(true) { |
1654 | 1674 |
Parent::setDigraph(digraph); |
1655 | 1675 |
Parent::setNodeFilterMap(const_true_map); |
1656 | 1676 |
Parent::setArcFilterMap(arc_filter); |
1657 | 1677 |
} |
1658 | 1678 |
|
1659 |
/// \brief |
|
1679 |
/// \brief Sets the status of the given arc |
|
1660 | 1680 |
/// |
1661 |
/// This function hides the given arc in the subdigraph, |
|
1662 |
/// i.e. the iteration jumps over it. |
|
1681 |
/// This function sets the status of the given arc. |
|
1663 | 1682 |
/// It is done by simply setting the assigned value of \c a |
1664 |
/// to be \c false in the arc filter map. |
|
1665 |
void hide(const Arc& a) const { Parent::hide(a); } |
|
1666 |
|
|
1667 |
/// \brief Shows the given arc |
|
1683 |
/// to \c v in the arc filter map. |
|
1684 |
void status(const Arc& a, bool v) const { Parent::status(a, v); } |
|
1685 |
|
|
1686 |
/// \brief Returns the status of the given arc |
|
1668 | 1687 |
/// |
1669 |
/// This function shows the given arc in the subdigraph. |
|
1670 |
/// It is done by simply setting the assigned value of \c a |
|
1671 |
/// to be \c true in the arc filter map. |
|
1672 |
void unHide(const Arc& a) const { Parent::unHide(a); } |
|
1673 |
|
|
1674 |
/// \brief Returns \c true if the given arc is hidden. |
|
1688 |
/// This function returns the status of the given arc. |
|
1689 |
/// It is \c true if the given arc is enabled (i.e. not hidden). |
|
1690 |
bool status(const Arc& a) const { return Parent::status(a); } |
|
1691 |
|
|
1692 |
/// \brief Disables the given arc |
|
1675 | 1693 |
/// |
1676 |
/// This function returns \c true if the given arc is hidden. |
|
1677 |
bool hidden(const Arc& a) const { return Parent::hidden(a); } |
|
1694 |
/// This function disables the given arc in the subdigraph, |
|
1695 |
/// so the iteration jumps over it. |
|
1696 |
/// It is the same as \ref status() "status(a, false)". |
|
1697 |
void disable(const Arc& a) const { Parent::status(a, false); } |
|
1698 |
|
|
1699 |
/// \brief Enables the given arc |
|
1700 |
/// |
|
1701 |
/// This function enables the given arc in the subdigraph. |
|
1702 |
/// It is the same as \ref status() "status(a, true)". |
|
1703 |
void enable(const Arc& a) const { Parent::status(a, true); } |
|
1678 | 1704 |
|
1679 | 1705 |
}; |
1680 | 1706 |
|
1681 | 1707 |
/// \brief Returns a read-only FilterArcs adaptor |
1682 | 1708 |
/// |
1683 | 1709 |
/// This function just returns a read-only \ref FilterArcs adaptor. |
1684 | 1710 |
/// \ingroup graph_adaptors |
1685 | 1711 |
/// \relates FilterArcs |
1686 | 1712 |
template<typename Digraph, typename ArcFilterMap> |
1687 | 1713 |
FilterArcs<const Digraph, ArcFilterMap> |
1688 | 1714 |
filterArcs(const Digraph& digraph, ArcFilterMap& afm) { |
1689 | 1715 |
return FilterArcs<const Digraph, ArcFilterMap>(digraph, afm); |
... | ... |
@@ -1745,43 +1771,49 @@ |
1745 | 1771 |
|
1746 | 1772 |
/// \brief Constructor |
1747 | 1773 |
/// |
1748 | 1774 |
/// Creates a subgraph for the given graph with the given edge |
1749 | 1775 |
/// filter map. |
1750 | 1776 |
FilterEdges(Graph& graph, EdgeFilterMap& edge_filter_map) : |
1751 | 1777 |
Parent(), const_true_map(true) { |
1752 | 1778 |
Parent::setGraph(graph); |
1753 | 1779 |
Parent::setNodeFilterMap(const_true_map); |
1754 | 1780 |
Parent::setEdgeFilterMap(edge_filter_map); |
1755 | 1781 |
} |
1756 | 1782 |
|
1757 |
/// \brief |
|
1783 |
/// \brief Sets the status of the given edge |
|
1758 | 1784 |
/// |
1759 |
/// This function hides the given edge in the subgraph, |
|
1760 |
/// i.e. the iteration jumps over it. |
|
1785 |
/// This function sets the status of the given edge. |
|
1761 | 1786 |
/// It is done by simply setting the assigned value of \c e |
1762 |
/// to be \c false in the edge filter map. |
|
1763 |
void hide(const Edge& e) const { Parent::hide(e); } |
|
1764 |
|
|
1765 |
/// \brief Shows the given edge |
|
1787 |
/// to \c v in the edge filter map. |
|
1788 |
void status(const Edge& e, bool v) const { Parent::status(e, v); } |
|
1789 |
|
|
1790 |
/// \brief Returns the status of the given edge |
|
1766 | 1791 |
/// |
1767 |
/// This function shows the given edge in the subgraph. |
|
1768 |
/// It is done by simply setting the assigned value of \c e |
|
1769 |
/// to be \c true in the edge filter map. |
|
1770 |
void unHide(const Edge& e) const { Parent::unHide(e); } |
|
1771 |
|
|
1772 |
/// \brief Returns \c true if the given edge is hidden. |
|
1792 |
/// This function returns the status of the given edge. |
|
1793 |
/// It is \c true if the given edge is enabled (i.e. not hidden). |
|
1794 |
bool status(const Edge& e) const { return Parent::status(e); } |
|
1795 |
|
|
1796 |
/// \brief Disables the given edge |
|
1773 | 1797 |
/// |
1774 |
/// This function returns \c true if the given edge is hidden. |
|
1775 |
bool hidden(const Edge& e) const { return Parent::hidden(e); } |
|
1798 |
/// This function disables the given edge in the subgraph, |
|
1799 |
/// so the iteration jumps over it. |
|
1800 |
/// It is the same as \ref status() "status(e, false)". |
|
1801 |
void disable(const Edge& e) const { Parent::status(e, false); } |
|
1802 |
|
|
1803 |
/// \brief Enables the given edge |
|
1804 |
/// |
|
1805 |
/// This function enables the given edge in the subgraph. |
|
1806 |
/// It is the same as \ref status() "status(e, true)". |
|
1807 |
void enable(const Edge& e) const { Parent::status(e, true); } |
|
1776 | 1808 |
|
1777 | 1809 |
}; |
1778 | 1810 |
|
1779 | 1811 |
/// \brief Returns a read-only FilterEdges adaptor |
1780 | 1812 |
/// |
1781 | 1813 |
/// This function just returns a read-only \ref FilterEdges adaptor. |
1782 | 1814 |
/// \ingroup graph_adaptors |
1783 | 1815 |
/// \relates FilterEdges |
1784 | 1816 |
template<typename Graph, typename EdgeFilterMap> |
1785 | 1817 |
FilterEdges<const Graph, EdgeFilterMap> |
1786 | 1818 |
filterEdges(const Graph& graph, EdgeFilterMap& efm) { |
1787 | 1819 |
return FilterEdges<const Graph, EdgeFilterMap>(graph, efm); |
... | ... |
@@ -2758,27 +2790,27 @@ |
2758 | 2790 |
|
2759 | 2791 |
/// \brief Returns the residual capacity of the given arc. |
2760 | 2792 |
/// |
2761 | 2793 |
/// Returns the residual capacity of the given arc. |
2762 | 2794 |
Value residualCapacity(const Arc& a) const { |
2763 | 2795 |
if (Undirected::direction(a)) { |
2764 | 2796 |
return (*_capacity)[a] - (*_flow)[a]; |
2765 | 2797 |
} else { |
2766 | 2798 |
return (*_flow)[a]; |
2767 | 2799 |
} |
2768 | 2800 |
} |
2769 | 2801 |
|
2770 |
/// \brief |
|
2802 |
/// \brief Augments on the given arc in the residual digraph. |
|
2771 | 2803 |
/// |
2772 |
/// |
|
2804 |
/// Augments on the given arc in the residual digraph. It increases |
|
2773 | 2805 |
/// or decreases the flow value on the original arc according to the |
2774 | 2806 |
/// direction of the residual arc. |
2775 | 2807 |
void augment(const Arc& a, const Value& v) const { |
2776 | 2808 |
if (Undirected::direction(a)) { |
2777 | 2809 |
_flow->set(a, (*_flow)[a] + v); |
2778 | 2810 |
} else { |
2779 | 2811 |
_flow->set(a, (*_flow)[a] - v); |
2780 | 2812 |
} |
2781 | 2813 |
} |
2782 | 2814 |
|
2783 | 2815 |
/// \brief Returns \c true if the given residual arc is a forward arc. |
2784 | 2816 |
/// |
0 comments (0 inline)