0
2
0
26
23
567
380
| ... | ... |
@@ -64,8 +64,10 @@ |
| 64 | 64 |
/** |
| 65 |
@defgroup graph_adaptors Adaptor Classes for |
|
| 65 |
@defgroup graph_adaptors Adaptor Classes for Graphs |
|
| 66 | 66 |
@ingroup graphs |
| 67 |
\brief |
|
| 67 |
\brief Adaptor classes for digraphs and graphs |
|
| 68 |
|
|
| 69 |
This group contains several useful adaptor classes for digraphs and graphs. |
|
| 68 | 70 |
|
| 69 | 71 |
The main parts of LEMON are the different graph structures, generic |
| 70 |
graph algorithms, graph concepts which couple |
|
| 72 |
graph algorithms, graph concepts, which couple them, and graph |
|
| 71 | 73 |
adaptors. While the previous notions are more or less clear, the |
| ... | ... |
@@ -75,3 +77,3 @@ |
| 75 | 77 |
A short example makes this much clearer. Suppose that we have an |
| 76 |
instance \c g of a directed graph type say ListDigraph and an algorithm |
|
| 78 |
instance \c g of a directed graph type, say ListDigraph and an algorithm |
|
| 77 | 79 |
\code |
| ... | ... |
@@ -83,9 +85,9 @@ |
| 83 | 85 |
arcs. In this case, an adaptor class is used, which (according |
| 84 |
to LEMON digraph concepts) works as a digraph. The adaptor uses the |
|
| 85 |
original digraph structure and digraph operations when methods of the |
|
| 86 |
reversed oriented graph are called. This means that the adaptor have |
|
| 87 |
minor memory usage, and do not perform sophisticated algorithmic |
|
| 86 |
to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph. |
|
| 87 |
The adaptor uses the original digraph structure and digraph operations when |
|
| 88 |
methods of the reversed oriented graph are called. This means that the adaptor |
|
| 89 |
have minor memory usage, and do not perform sophisticated algorithmic |
|
| 88 | 90 |
actions. The purpose of it is to give a tool for the cases when a |
| 89 | 91 |
graph have to be used in a specific alteration. If this alteration is |
| 90 |
obtained by a usual construction like filtering the arc |
|
| 92 |
obtained by a usual construction like filtering the node or the arc set or |
|
| 91 | 93 |
considering a new orientation, then an adaptor is worthwhile to use. |
| ... | ... |
@@ -98,12 +100,12 @@ |
| 98 | 100 |
ListDigraph g; |
| 99 |
ReverseDigraph< |
|
| 101 |
ReverseDigraph<ListDigraph> rg(g); |
|
| 100 | 102 |
int result = algorithm(rg); |
| 101 | 103 |
\endcode |
| 102 |
After running the algorithm, the original graph \c g is untouched. |
|
| 103 |
This techniques gives rise to an elegant code, and based on stable |
|
| 104 |
During running the algorithm, the original digraph \c g is untouched. |
|
| 105 |
This techniques give rise to an elegant code, and based on stable |
|
| 104 | 106 |
graph adaptors, complex algorithms can be implemented easily. |
| 105 | 107 |
|
| 106 |
In flow, circulation and |
|
| 108 |
In flow, circulation and matching problems, the residual |
|
| 107 | 109 |
graph is of particular importance. Combining an adaptor implementing |
| 108 |
this |
|
| 110 |
this with shortest path algorithms or minimum mean cycle algorithms, |
|
| 109 | 111 |
a range of weighted and cardinality optimization algorithms can be |
| ... | ... |
@@ -114,10 +116,11 @@ |
| 114 | 116 |
capabilities of the original graph while in other cases this would be |
| 115 |
meaningless. This means that the concepts that they are models of depend |
|
| 116 |
on the graph adaptor, and the wrapped graph(s). |
|
| 117 |
If an arc of \c rg is deleted, this is carried out by deleting the |
|
| 118 |
corresponding arc of \c g, thus the adaptor modifies the original graph. |
|
| 117 |
meaningless. This means that the concepts that they meet depend |
|
| 118 |
on the graph adaptor, and the wrapped graph. |
|
| 119 |
For example, if an arc of a reversed digraph is deleted, this is carried |
|
| 120 |
out by deleting the corresponding arc of the original digraph, thus the |
|
| 121 |
adaptor modifies the original digraph. |
|
| 122 |
However in case of a residual digraph, this operation has no sense. |
|
| 119 | 123 |
|
| 120 |
But for a residual graph, this operation has no sense. |
|
| 121 | 124 |
Let us stand one more example here to simplify your work. |
| 122 |
|
|
| 125 |
ReverseDigraph has constructor |
|
| 123 | 126 |
\code |
| ... | ... |
@@ -125,8 +128,8 @@ |
| 125 | 128 |
\endcode |
| 126 |
This means that in a situation, when a <tt>const ListDigraph&</tt> |
|
| 129 |
This means that in a situation, when a <tt>const %ListDigraph&</tt> |
|
| 127 | 130 |
reference to a graph is given, then it have to be instantiated with |
| 128 |
<tt>Digraph=const ListDigraph</tt>. |
|
| 131 |
<tt>Digraph=const %ListDigraph</tt>. |
|
| 129 | 132 |
\code |
| 130 | 133 |
int algorithm1(const ListDigraph& g) {
|
| 131 |
|
|
| 134 |
ReverseDigraph<const ListDigraph> rg(g); |
|
| 132 | 135 |
return algorithm2(rg); |
| ... | ... |
@@ -23,3 +23,3 @@ |
| 23 | 23 |
/// \file |
| 24 |
/// \brief |
|
| 24 |
/// \brief Adaptor classes for digraphs and graphs |
|
| 25 | 25 |
/// |
| ... | ... |
@@ -348,10 +348,18 @@ |
| 348 | 348 |
/// |
| 349 |
/// \brief |
|
| 349 |
/// \brief Adaptor class for reversing the orientation of the arcs in |
|
| 350 |
/// a digraph. |
|
| 350 | 351 |
/// |
| 351 |
/// ReverseDigraph reverses the arcs in the adapted digraph. The |
|
| 352 |
/// SubDigraph is conform to the \ref concepts::Digraph |
|
| 353 |
/// |
|
| 352 |
/// ReverseDigraph can be used for reversing the arcs in a digraph. |
|
| 353 |
/// It conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 354 | 354 |
/// |
| 355 |
/// \tparam _Digraph It must be conform to the \ref concepts::Digraph |
|
| 356 |
/// "Digraph concept". The type can be specified to be const. |
|
| 355 |
/// The adapted digraph can also be modified through this adaptor |
|
| 356 |
/// by adding or removing nodes or arcs, unless the \c _Digraph template |
|
| 357 |
/// parameter is set to be \c const. |
|
| 358 |
/// |
|
| 359 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 360 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 361 |
/// It can also be specified to be \c const. |
|
| 362 |
/// |
|
| 363 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 364 |
/// digraph are convertible to each other. |
|
| 357 | 365 |
template<typename _Digraph> |
| ... | ... |
@@ -369,3 +377,3 @@ |
| 369 | 377 |
/// |
| 370 |
/// Creates a reverse digraph adaptor for the given digraph |
|
| 378 |
/// Creates a reverse digraph adaptor for the given digraph. |
|
| 371 | 379 |
explicit ReverseDigraph(Digraph& digraph) {
|
| ... | ... |
@@ -375,5 +383,7 @@ |
| 375 | 383 |
|
| 376 |
/// \brief |
|
| 384 |
/// \brief Returns a read-only ReverseDigraph adaptor |
|
| 377 | 385 |
/// |
| 378 |
/// |
|
| 386 |
/// This function just returns a read-only \ref ReverseDigraph adaptor. |
|
| 387 |
/// \ingroup graph_adaptors |
|
| 388 |
/// \relates ReverseDigraph |
|
| 379 | 389 |
template<typename Digraph> |
| ... | ... |
@@ -383,2 +393,3 @@ |
| 383 | 393 |
|
| 394 |
|
|
| 384 | 395 |
template <typename _Digraph, typename _NodeFilterMap, |
| ... | ... |
@@ -687,20 +698,33 @@ |
| 687 | 698 |
/// |
| 688 |
/// \brief |
|
| 699 |
/// \brief Adaptor class for hiding nodes and arcs in a digraph |
|
| 689 | 700 |
/// |
| 690 |
/// SubDigraph hides nodes and arcs in a digraph. A bool node map |
|
| 691 |
/// and a bool arc map must be specified, which define the filters |
|
| 692 |
/// for nodes and arcs. Just the nodes and arcs with true value are |
|
| 693 |
/// shown in the subdigraph. The SubDigraph is conform to the \ref |
|
| 694 |
/// concepts::Digraph "Digraph concept". If the \c _checked parameter |
|
| 695 |
/// is true, then the arcs incident to filtered nodes are also |
|
| 701 |
/// SubDigraph can be used for hiding nodes and arcs in a digraph. |
|
| 702 |
/// A \c bool node map and a \c bool arc map must be specified, which |
|
| 703 |
/// define the filters for nodes and arcs. |
|
| 704 |
/// Only the nodes and arcs with \c true filter value are |
|
| 705 |
/// shown in the subdigraph. This adaptor conforms to the \ref |
|
| 706 |
/// concepts::Digraph "Digraph" concept. If the \c _checked parameter |
|
| 707 |
/// is \c true, then the arcs incident to hidden nodes are also |
|
| 696 | 708 |
/// filtered out. |
| 697 | 709 |
/// |
| 698 |
/// \tparam _Digraph It must be conform to the \ref |
|
| 699 |
/// concepts::Digraph "Digraph concept". The type can be specified |
|
| 700 |
/// to const. |
|
| 701 |
/// \tparam _NodeFilterMap A bool valued node map of the the adapted digraph. |
|
| 702 |
/// \tparam _ArcFilterMap A bool valued arc map of the the adapted digraph. |
|
| 703 |
/// \tparam _checked If the parameter is false then the arc filtering |
|
| 704 |
/// is not checked with respect to node filter. Otherwise, each arc |
|
| 705 |
/// is automatically filtered, which is incident to a filtered node. |
|
| 710 |
/// The adapted digraph can also be modified through this adaptor |
|
| 711 |
/// by adding or removing nodes or arcs, unless the \c _Digraph template |
|
| 712 |
/// parameter is set to be \c const. |
|
| 713 |
/// |
|
| 714 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 715 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 716 |
/// It can also be specified to be \c const. |
|
| 717 |
/// \tparam _NodeFilterMap A \c bool (or convertible) node map of the |
|
| 718 |
/// adapted digraph. The default map type is |
|
| 719 |
/// \ref concepts::Digraph::NodeMap "_Digraph::NodeMap<bool>". |
|
| 720 |
/// \tparam _ArcFilterMap A \c bool (or convertible) arc map of the |
|
| 721 |
/// adapted digraph. The default map type is |
|
| 722 |
/// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<bool>". |
|
| 723 |
/// \tparam _checked If this parameter is set to \c false, then the arc |
|
| 724 |
/// filtering is not checked with respect to the node filter. |
|
| 725 |
/// Otherwise, each arc that is incident to a hidden node is automatically |
|
| 726 |
/// filtered out. This is the default option. |
|
| 727 |
/// |
|
| 728 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 729 |
/// digraph are convertible to each other. |
|
| 706 | 730 |
/// |
| ... | ... |
@@ -708,2 +732,8 @@ |
| 708 | 732 |
/// \see FilterArcs |
| 733 |
#ifdef DOXYGEN |
|
| 734 |
template<typename _Digraph, |
|
| 735 |
typename _NodeFilterMap, |
|
| 736 |
typename _ArcFilterMap, |
|
| 737 |
bool _checked> |
|
| 738 |
#else |
|
| 709 | 739 |
template<typename _Digraph, |
| ... | ... |
@@ -712,2 +742,3 @@ |
| 712 | 742 |
bool _checked = true> |
| 743 |
#endif |
|
| 713 | 744 |
class SubDigraph |
| ... | ... |
@@ -716,4 +747,7 @@ |
| 716 | 747 |
public: |
| 748 |
/// The type of the adapted digraph. |
|
| 717 | 749 |
typedef _Digraph Digraph; |
| 750 |
/// The type of the node filter map. |
|
| 718 | 751 |
typedef _NodeFilterMap NodeFilterMap; |
| 752 |
/// The type of the arc filter map. |
|
| 719 | 753 |
typedef _ArcFilterMap ArcFilterMap; |
| ... | ... |
@@ -721,3 +755,3 @@ |
| 721 | 755 |
typedef DigraphAdaptorExtender< |
| 722 |
SubDigraphBase< |
|
| 756 |
SubDigraphBase<_Digraph, _NodeFilterMap, _ArcFilterMap, _checked> > |
|
| 723 | 757 |
Parent; |
| ... | ... |
@@ -733,4 +767,4 @@ |
| 733 | 767 |
/// |
| 734 |
/// Creates a subdigraph for the given digraph with |
|
| 735 |
/// given node and arc map filters. |
|
| 768 |
/// Creates a subdigraph for the given digraph with the |
|
| 769 |
/// given node and arc filter maps. |
|
| 736 | 770 |
SubDigraph(Digraph& digraph, NodeFilterMap& node_filter, |
| ... | ... |
@@ -742,40 +776,40 @@ |
| 742 | 776 |
|
| 743 |
/// \brief Hides the |
|
| 777 |
/// \brief Hides the given node |
|
| 744 | 778 |
/// |
| 745 |
/// This function hides \c n in the digraph, i.e. the iteration |
|
| 746 |
/// jumps over it. This is done by simply setting the value of \c n |
|
| 747 |
/// |
|
| 779 |
/// This function hides the given node in the subdigraph, |
|
| 780 |
/// i.e. the iteration jumps over it. |
|
| 781 |
/// It is done by simply setting the assigned value of \c n |
|
| 782 |
/// to be \c false in the node filter map. |
|
| 748 | 783 |
void hide(const Node& n) const { Parent::hide(n); }
|
| 749 | 784 |
|
| 750 |
/// \brief Hides the |
|
| 785 |
/// \brief Hides the given arc |
|
| 751 | 786 |
/// |
| 752 |
/// This function hides \c a in the digraph, i.e. the iteration |
|
| 753 |
/// jumps over it. This is done by simply setting the value of \c a |
|
| 754 |
/// |
|
| 787 |
/// This function hides the given arc in the subdigraph, |
|
| 788 |
/// i.e. the iteration jumps over it. |
|
| 789 |
/// It is done by simply setting the assigned value of \c a |
|
| 790 |
/// to be \c false in the arc filter map. |
|
| 755 | 791 |
void hide(const Arc& a) const { Parent::hide(a); }
|
| 756 | 792 |
|
| 757 |
/// \brief |
|
| 793 |
/// \brief Shows the given node |
|
| 758 | 794 |
/// |
| 759 |
/// The value of \c n is set to be true in the node-map which stores |
|
| 760 |
/// hide information. If \c n was hidden previuosly, then it is shown |
|
| 761 |
/// |
|
| 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. |
|
| 762 | 798 |
void unHide(const Node& n) const { Parent::unHide(n); }
|
| 763 | 799 |
|
| 764 |
/// \brief |
|
| 800 |
/// \brief Shows the given arc |
|
| 765 | 801 |
/// |
| 766 |
/// The value of \c a is set to be true in the arc-map which stores |
|
| 767 |
/// hide information. If \c a was hidden previuosly, then it is shown |
|
| 768 |
/// |
|
| 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. |
|
| 769 | 805 |
void unHide(const Arc& a) const { Parent::unHide(a); }
|
| 770 | 806 |
|
| 771 |
/// \brief Returns true if |
|
| 807 |
/// \brief Returns \c true if the given node is hidden. |
|
| 772 | 808 |
/// |
| 773 |
/// |
|
| 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. |
|
| 774 | 813 |
/// |
| 775 |
bool hidden(const Node& n) const { return Parent::hidden(n); }
|
|
| 776 |
|
|
| 777 |
/// \brief Returns true if \c a is hidden. |
|
| 778 |
/// |
|
| 779 |
/// Returns true if \c a is hidden. |
|
| 780 |
/// |
|
| 814 |
/// This function returns \c true if the given arc is hidden. |
|
| 781 | 815 |
bool hidden(const Arc& a) const { return Parent::hidden(a); }
|
| ... | ... |
@@ -784,5 +818,7 @@ |
| 784 | 818 |
|
| 785 |
/// \brief |
|
| 819 |
/// \brief Returns a read-only SubDigraph adaptor |
|
| 786 | 820 |
/// |
| 787 |
/// |
|
| 821 |
/// This function just returns a read-only \ref SubDigraph adaptor. |
|
| 822 |
/// \ingroup graph_adaptors |
|
| 823 |
/// \relates SubDigraph |
|
| 788 | 824 |
template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap> |
| ... | ... |
@@ -1251,21 +1287,34 @@ |
| 1251 | 1287 |
/// |
| 1252 |
/// \brief A graph adaptor for hiding nodes and edges in an |
|
| 1253 |
/// undirected graph. |
|
| 1288 |
/// \brief Adaptor class for hiding nodes and edges in an undirected |
|
| 1289 |
/// graph. |
|
| 1254 | 1290 |
/// |
| 1255 |
/// SubGraph hides nodes and edges in a graph. A bool node map and a |
|
| 1256 |
/// bool edge map must be specified, which define the filters for |
|
| 1257 |
/// nodes and edges. Just the nodes and edges with true value are |
|
| 1258 |
/// shown in the subgraph. The SubGraph is conform to the \ref |
|
| 1259 |
/// concepts::Graph "Graph concept". If the \c _checked parameter is |
|
| 1260 |
/// true, then the edges incident to filtered nodes are also |
|
| 1291 |
/// SubGraph can be used for hiding nodes and edges in a graph. |
|
| 1292 |
/// A \c bool node map and a \c bool edge map must be specified, which |
|
| 1293 |
/// define the filters for nodes and edges. |
|
| 1294 |
/// Only the nodes and edges with \c true filter value are |
|
| 1295 |
/// shown in the subgraph. This adaptor conforms to the \ref |
|
| 1296 |
/// concepts::Graph "Graph" concept. If the \c _checked parameter is |
|
| 1297 |
/// \c true, then the edges incident to hidden nodes are also |
|
| 1261 | 1298 |
/// filtered out. |
| 1262 | 1299 |
/// |
| 1263 |
/// \tparam _Graph It must be conform to the \ref |
|
| 1264 |
/// concepts::Graph "Graph concept". The type can be specified |
|
| 1265 |
/// to const. |
|
| 1266 |
/// \tparam _NodeFilterMap A bool valued node map of the the adapted graph. |
|
| 1267 |
/// \tparam _EdgeFilterMap A bool valued edge map of the the adapted graph. |
|
| 1268 |
/// \tparam _checked If the parameter is false then the edge filtering |
|
| 1269 |
/// is not checked with respect to node filter. Otherwise, each edge |
|
| 1270 |
/// is automatically filtered, which is incident to a filtered node. |
|
| 1300 |
/// The adapted graph can also be modified through this adaptor |
|
| 1301 |
/// by adding or removing nodes or edges, unless the \c _Graph template |
|
| 1302 |
/// parameter is set to be \c const. |
|
| 1303 |
/// |
|
| 1304 |
/// \tparam _Graph The type of the adapted graph. |
|
| 1305 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 1306 |
/// It can also be specified to be \c const. |
|
| 1307 |
/// \tparam _NodeFilterMap A \c bool (or convertible) node map of the |
|
| 1308 |
/// adapted graph. The default map type is |
|
| 1309 |
/// \ref concepts::Graph::NodeMap "_Graph::NodeMap<bool>". |
|
| 1310 |
/// \tparam _EdgeFilterMap A \c bool (or convertible) edge map of the |
|
| 1311 |
/// adapted graph. The default map type is |
|
| 1312 |
/// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>". |
|
| 1313 |
/// \tparam _checked If this parameter is set to \c false, then the edge |
|
| 1314 |
/// filtering is not checked with respect to the node filter. |
|
| 1315 |
/// Otherwise, each edge that is incident to a hidden node is automatically |
|
| 1316 |
/// filtered out. This is the default option. |
|
| 1317 |
/// |
|
| 1318 |
/// \note The \c Node, \c Edge and \c Arc types of this adaptor and the |
|
| 1319 |
/// adapted graph are convertible to each other. |
|
| 1271 | 1320 |
/// |
| ... | ... |
@@ -1273,11 +1322,26 @@ |
| 1273 | 1322 |
/// \see FilterEdges |
| 1274 |
template<typename _Graph, typename NodeFilterMap, |
|
| 1275 |
typename EdgeFilterMap, bool _checked = true> |
|
| 1323 |
#ifdef DOXYGEN |
|
| 1324 |
template<typename _Graph, |
|
| 1325 |
typename _NodeFilterMap, |
|
| 1326 |
typename _EdgeFilterMap, |
|
| 1327 |
bool _checked> |
|
| 1328 |
#else |
|
| 1329 |
template<typename _Graph, |
|
| 1330 |
typename _NodeFilterMap = typename _Graph::template NodeMap<bool>, |
|
| 1331 |
typename _EdgeFilterMap = typename _Graph::template EdgeMap<bool>, |
|
| 1332 |
bool _checked = true> |
|
| 1333 |
#endif |
|
| 1276 | 1334 |
class SubGraph |
| 1277 | 1335 |
: public GraphAdaptorExtender< |
| 1278 |
SubGraphBase<_Graph, |
|
| 1336 |
SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, _checked> > {
|
|
| 1279 | 1337 |
public: |
| 1338 |
/// The type of the adapted graph. |
|
| 1280 | 1339 |
typedef _Graph Graph; |
| 1340 |
/// The type of the node filter map. |
|
| 1341 |
typedef _NodeFilterMap NodeFilterMap; |
|
| 1342 |
/// The type of the edge filter map. |
|
| 1343 |
typedef _EdgeFilterMap EdgeFilterMap; |
|
| 1344 |
|
|
| 1281 | 1345 |
typedef GraphAdaptorExtender< |
| 1282 |
SubGraphBase<_Graph, |
|
| 1346 |
SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, _checked> > Parent; |
|
| 1283 | 1347 |
|
| ... | ... |
@@ -1292,7 +1356,7 @@ |
| 1292 | 1356 |
/// |
| 1293 |
/// Creates a subgraph for the given graph with given node and |
|
| 1294 |
/// edge map filters. |
|
| 1295 |
|
|
| 1357 |
/// Creates a subgraph for the given graph with the given node |
|
| 1358 |
/// and edge filter maps. |
|
| 1359 |
SubGraph(Graph& graph, NodeFilterMap& node_filter_map, |
|
| 1296 | 1360 |
EdgeFilterMap& edge_filter_map) {
|
| 1297 |
setGraph( |
|
| 1361 |
setGraph(graph); |
|
| 1298 | 1362 |
setNodeFilterMap(node_filter_map); |
| ... | ... |
@@ -1301,40 +1365,40 @@ |
| 1301 | 1365 |
|
| 1302 |
/// \brief Hides the |
|
| 1366 |
/// \brief Hides the given node |
|
| 1303 | 1367 |
/// |
| 1304 |
/// This function hides \c n in the graph, i.e. the iteration |
|
| 1305 |
/// jumps over it. This is done by simply setting the value of \c n |
|
| 1306 |
/// |
|
| 1368 |
/// This function hides the given node in the subgraph, |
|
| 1369 |
/// i.e. the iteration jumps over it. |
|
| 1370 |
/// It is done by simply setting the assigned value of \c n |
|
| 1371 |
/// to be \c false in the node filter map. |
|
| 1307 | 1372 |
void hide(const Node& n) const { Parent::hide(n); }
|
| 1308 | 1373 |
|
| 1309 |
/// \brief Hides the |
|
| 1374 |
/// \brief Hides the given edge |
|
| 1310 | 1375 |
/// |
| 1311 |
/// This function hides \c e in the graph, i.e. the iteration |
|
| 1312 |
/// jumps over it. This is done by simply setting the value of \c e |
|
| 1313 |
/// |
|
| 1376 |
/// This function hides the given edge in the subgraph, |
|
| 1377 |
/// i.e. the iteration jumps over it. |
|
| 1378 |
/// It is done by simply setting the assigned value of \c e |
|
| 1379 |
/// to be \c false in the edge filter map. |
|
| 1314 | 1380 |
void hide(const Edge& e) const { Parent::hide(e); }
|
| 1315 | 1381 |
|
| 1316 |
/// \brief |
|
| 1382 |
/// \brief Shows the given node |
|
| 1317 | 1383 |
/// |
| 1318 |
/// The value of \c n is set to be true in the node-map which stores |
|
| 1319 |
/// hide information. If \c n was hidden previuosly, then it is shown |
|
| 1320 |
/// |
|
| 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. |
|
| 1321 | 1387 |
void unHide(const Node& n) const { Parent::unHide(n); }
|
| 1322 | 1388 |
|
| 1323 |
/// \brief |
|
| 1389 |
/// \brief Shows the given edge |
|
| 1324 | 1390 |
/// |
| 1325 |
/// The value of \c e is set to be true in the edge-map which stores |
|
| 1326 |
/// hide information. If \c e was hidden previuosly, then it is shown |
|
| 1327 |
/// |
|
| 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. |
|
| 1328 | 1394 |
void unHide(const Edge& e) const { Parent::unHide(e); }
|
| 1329 | 1395 |
|
| 1330 |
/// \brief Returns true if |
|
| 1396 |
/// \brief Returns \c true if the given node is hidden. |
|
| 1331 | 1397 |
/// |
| 1332 |
/// |
|
| 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. |
|
| 1333 | 1402 |
/// |
| 1334 |
bool hidden(const Node& n) const { return Parent::hidden(n); }
|
|
| 1335 |
|
|
| 1336 |
/// \brief Returns true if \c e is hidden. |
|
| 1337 |
/// |
|
| 1338 |
/// Returns true if \c e is hidden. |
|
| 1339 |
/// |
|
| 1403 |
/// This function returns \c true if the given edge is hidden. |
|
| 1340 | 1404 |
bool hidden(const Edge& e) const { return Parent::hidden(e); }
|
| ... | ... |
@@ -1342,5 +1406,7 @@ |
| 1342 | 1406 |
|
| 1343 |
/// \brief |
|
| 1407 |
/// \brief Returns a read-only SubGraph adaptor |
|
| 1344 | 1408 |
/// |
| 1345 |
/// |
|
| 1409 |
/// This function just returns a read-only \ref SubGraph adaptor. |
|
| 1410 |
/// \ingroup graph_adaptors |
|
| 1411 |
/// \relates SubGraph |
|
| 1346 | 1412 |
template<typename Graph, typename NodeFilterMap, typename ArcFilterMap> |
| ... | ... |
@@ -1375,28 +1441,38 @@ |
| 1375 | 1441 |
|
| 1442 |
|
|
| 1376 | 1443 |
/// \ingroup graph_adaptors |
| 1377 | 1444 |
/// |
| 1378 |
/// \brief |
|
| 1445 |
/// \brief Adaptor class for hiding nodes in a digraph or a graph. |
|
| 1379 | 1446 |
/// |
| 1380 |
/// FilterNodes adaptor hides nodes in a graph or a digraph. A bool |
|
| 1381 |
/// node map must be specified, which defines the filters for |
|
| 1382 |
/// nodes. Just the unfiltered nodes and the arcs or edges incident |
|
| 1383 |
/// to unfiltered nodes are shown in the subdigraph or subgraph. The |
|
| 1384 |
/// FilterNodes is conform to the \ref concepts::Digraph |
|
| 1385 |
/// "Digraph concept" or \ref concepts::Graph "Graph concept" depending |
|
| 1386 |
/// on the \c _Digraph template parameter. If the \c _checked |
|
| 1387 |
/// parameter is true, then the arc or edges incident to filtered nodes |
|
| 1388 |
/// |
|
| 1447 |
/// FilterNodes adaptor can be used for hiding nodes in a digraph or a |
|
| 1448 |
/// graph. A \c bool node map must be specified, which defines the filter |
|
| 1449 |
/// for the nodes. Only the nodes with \c true filter value and the |
|
| 1450 |
/// arcs/edges incident to nodes both with \c true filter value are shown |
|
| 1451 |
/// in the subgraph. This adaptor conforms to the \ref concepts::Digraph |
|
| 1452 |
/// "Digraph" concept or the \ref concepts::Graph "Graph" concept |
|
| 1453 |
/// depending on the \c _Graph template parameter. |
|
| 1389 | 1454 |
/// |
| 1390 |
/// \tparam _Digraph It must be conform to the \ref |
|
| 1391 |
/// concepts::Digraph "Digraph concept" or \ref concepts::Graph |
|
| 1392 |
/// "Graph concept". The type can be specified to be const. |
|
| 1393 |
/// \tparam _NodeFilterMap A bool valued node map of the the adapted graph. |
|
| 1394 |
/// \tparam _checked If the parameter is false then the arc or edge |
|
| 1395 |
/// filtering is not checked with respect to node filter. In this |
|
| 1396 |
/// case just isolated nodes can be filtered out from the |
|
| 1397 |
/// graph. |
|
| 1455 |
/// The adapted (di)graph can also be modified through this adaptor |
|
| 1456 |
/// by adding or removing nodes or arcs/edges, unless the \c _Graph template |
|
| 1457 |
/// parameter is set to be \c const. |
|
| 1458 |
/// |
|
| 1459 |
/// \tparam _Graph The type of the adapted digraph or graph. |
|
| 1460 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept |
|
| 1461 |
/// or the \ref concepts::Graph "Graph" concept. |
|
| 1462 |
/// It can also be specified to be \c const. |
|
| 1463 |
/// \tparam _NodeFilterMap A \c bool (or convertible) node map of the |
|
| 1464 |
/// adapted (di)graph. The default map type is |
|
| 1465 |
/// \ref concepts::Graph::NodeMap "_Graph::NodeMap<bool>". |
|
| 1466 |
/// \tparam _checked If this parameter is set to \c false then the arc/edge |
|
| 1467 |
/// filtering is not checked with respect to the node filter. In this |
|
| 1468 |
/// case only isolated nodes can be filtered out from the graph. |
|
| 1469 |
/// Otherwise, each arc/edge that is incident to a hidden node is |
|
| 1470 |
/// automatically filtered out. This is the default option. |
|
| 1471 |
/// |
|
| 1472 |
/// \note The \c Node and <tt>Arc/Edge</tt> types of this adaptor and the |
|
| 1473 |
/// adapted (di)graph are convertible to each other. |
|
| 1398 | 1474 |
#ifdef DOXYGEN |
| 1399 |
template<typename _Digraph, |
|
| 1400 |
typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>, |
|
| 1401 |
|
|
| 1475 |
template<typename _Graph, |
|
| 1476 |
typename _NodeFilterMap, |
|
| 1477 |
bool _checked> |
|
| 1402 | 1478 |
#else |
| ... | ... |
@@ -1432,7 +1508,11 @@ |
| 1432 | 1508 |
/// |
| 1433 |
/// Creates |
|
| 1509 |
/// Creates a subgraph for the given digraph or graph with the |
|
| 1434 | 1510 |
/// given node filter map. |
| 1435 |
|
|
| 1511 |
#ifdef DOXYGEN |
|
| 1512 |
FilterNodes(_Graph& graph, _NodeFilterMap& node_filter) : |
|
| 1513 |
#else |
|
| 1514 |
FilterNodes(Digraph& graph, NodeFilterMap& node_filter) : |
|
| 1515 |
#endif |
|
| 1436 | 1516 |
Parent(), const_true_map(true) {
|
| 1437 |
Parent::setDigraph( |
|
| 1517 |
Parent::setDigraph(graph); |
|
| 1438 | 1518 |
Parent::setNodeFilterMap(node_filter); |
| ... | ... |
@@ -1441,20 +1521,20 @@ |
| 1441 | 1521 |
|
| 1442 |
/// \brief Hides the |
|
| 1522 |
/// \brief Hides the given node |
|
| 1443 | 1523 |
/// |
| 1444 |
/// This function hides \c n in the digraph or graph, i.e. the iteration |
|
| 1445 |
/// jumps over it. This is done by simply setting the value of \c n |
|
| 1446 |
/// |
|
| 1524 |
/// This function hides the given node in the subgraph, |
|
| 1525 |
/// i.e. the iteration jumps over it. |
|
| 1526 |
/// It is done by simply setting the assigned value of \c n |
|
| 1527 |
/// to be \c false in the node filter map. |
|
| 1447 | 1528 |
void hide(const Node& n) const { Parent::hide(n); }
|
| 1448 | 1529 |
|
| 1449 |
/// \brief |
|
| 1530 |
/// \brief Shows the given node |
|
| 1450 | 1531 |
/// |
| 1451 |
/// The value of \c n is set to be true in the node-map which stores |
|
| 1452 |
/// hide information. If \c n was hidden previuosly, then it is shown |
|
| 1453 |
/// |
|
| 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. |
|
| 1454 | 1535 |
void unHide(const Node& n) const { Parent::unHide(n); }
|
| 1455 | 1536 |
|
| 1456 |
/// \brief Returns true if |
|
| 1537 |
/// \brief Returns \c true if the given node is hidden. |
|
| 1457 | 1538 |
/// |
| 1458 |
/// Returns true if \c n is hidden. |
|
| 1459 |
/// |
|
| 1539 |
/// This function returns \c true if the given node is hidden. |
|
| 1460 | 1540 |
bool hidden(const Node& n) const { return Parent::hidden(n); }
|
| ... | ... |
@@ -1498,5 +1578,7 @@ |
| 1498 | 1578 |
|
| 1499 |
/// \brief |
|
| 1579 |
/// \brief Returns a read-only FilterNodes adaptor |
|
| 1500 | 1580 |
/// |
| 1501 |
/// |
|
| 1581 |
/// This function just returns a read-only \ref FilterNodes adaptor. |
|
| 1582 |
/// \ingroup graph_adaptors |
|
| 1583 |
/// \relates FilterNodes |
|
| 1502 | 1584 |
template<typename Digraph, typename NodeFilterMap> |
| ... | ... |
@@ -1515,14 +1597,30 @@ |
| 1515 | 1597 |
/// |
| 1516 |
/// \brief |
|
| 1598 |
/// \brief Adaptor class for hiding arcs in a digraph. |
|
| 1517 | 1599 |
/// |
| 1518 |
/// FilterArcs adaptor hides arcs in a digraph. A bool arc map must |
|
| 1519 |
/// be specified, which defines the filters for arcs. Just the |
|
| 1520 |
/// unfiltered arcs are shown in the subdigraph. The FilterArcs is |
|
| 1521 |
/// conform to the \ref concepts::Digraph "Digraph concept". |
|
| 1600 |
/// FilterArcs adaptor can be used for hiding arcs in a digraph. |
|
| 1601 |
/// A \c bool arc map must be specified, which defines the filter for |
|
| 1602 |
/// the arcs. Only the arcs with \c true filter value are shown in the |
|
| 1603 |
/// subdigraph. This adaptor conforms to the \ref concepts::Digraph |
|
| 1604 |
/// "Digraph" concept. |
|
| 1522 | 1605 |
/// |
| 1523 |
/// \tparam _Digraph It must be conform to the \ref concepts::Digraph |
|
| 1524 |
/// "Digraph concept". The type can be specified to be const. |
|
| 1525 |
/// \tparam _ArcFilterMap A bool valued arc map of the the adapted |
|
| 1526 |
/// graph. |
|
| 1527 |
|
|
| 1606 |
/// The adapted digraph can also be modified through this adaptor |
|
| 1607 |
/// by adding or removing nodes or arcs, unless the \c _Digraph template |
|
| 1608 |
/// parameter is set to be \c const. |
|
| 1609 |
/// |
|
| 1610 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 1611 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 1612 |
/// It can also be specified to be \c const. |
|
| 1613 |
/// \tparam _ArcFilterMap A \c bool (or convertible) arc map of the |
|
| 1614 |
/// adapted digraph. The default map type is |
|
| 1615 |
/// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<bool>". |
|
| 1616 |
/// |
|
| 1617 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 1618 |
/// digraph are convertible to each other. |
|
| 1619 |
#ifdef DOXYGEN |
|
| 1620 |
template<typename _Digraph, |
|
| 1621 |
typename _ArcFilterMap> |
|
| 1622 |
#else |
|
| 1623 |
template<typename _Digraph, |
|
| 1624 |
typename _ArcFilterMap = typename _Digraph::template ArcMap<bool> > |
|
| 1625 |
#endif |
|
| 1528 | 1626 |
class FilterArcs : |
| ... | ... |
@@ -1531,2 +1629,3 @@ |
| 1531 | 1629 |
public: |
| 1630 |
|
|
| 1532 | 1631 |
typedef _Digraph Digraph; |
| ... | ... |
@@ -1550,4 +1649,4 @@ |
| 1550 | 1649 |
/// |
| 1551 |
/// Creates a FilterArcs adaptor for the given graph with |
|
| 1552 |
/// given arc map filter. |
|
| 1650 |
/// Creates a subdigraph for the given digraph with the given arc |
|
| 1651 |
/// filter map. |
|
| 1553 | 1652 |
FilterArcs(Digraph& digraph, ArcFilterMap& arc_filter) |
| ... | ... |
@@ -1559,20 +1658,20 @@ |
| 1559 | 1658 |
|
| 1560 |
/// \brief Hides the |
|
| 1659 |
/// \brief Hides the given arc |
|
| 1561 | 1660 |
/// |
| 1562 |
/// This function hides \c a in the graph, i.e. the iteration |
|
| 1563 |
/// jumps over it. This is done by simply setting the value of \c a |
|
| 1564 |
/// |
|
| 1661 |
/// This function hides the given arc in the subdigraph, |
|
| 1662 |
/// i.e. the iteration jumps over it. |
|
| 1663 |
/// It is done by simply setting the assigned value of \c a |
|
| 1664 |
/// to be \c false in the arc filter map. |
|
| 1565 | 1665 |
void hide(const Arc& a) const { Parent::hide(a); }
|
| 1566 | 1666 |
|
| 1567 |
/// \brief |
|
| 1667 |
/// \brief Shows the given arc |
|
| 1568 | 1668 |
/// |
| 1569 |
/// The value of \c a is set to be true in the arc-map which stores |
|
| 1570 |
/// hide information. If \c a was hidden previuosly, then it is shown |
|
| 1571 |
/// |
|
| 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. |
|
| 1572 | 1672 |
void unHide(const Arc& a) const { Parent::unHide(a); }
|
| 1573 | 1673 |
|
| 1574 |
/// \brief Returns true if |
|
| 1674 |
/// \brief Returns \c true if the given arc is hidden. |
|
| 1575 | 1675 |
/// |
| 1576 |
/// Returns true if \c a is hidden. |
|
| 1577 |
/// |
|
| 1676 |
/// This function returns \c true if the given arc is hidden. |
|
| 1578 | 1677 |
bool hidden(const Arc& a) const { return Parent::hidden(a); }
|
| ... | ... |
@@ -1581,5 +1680,7 @@ |
| 1581 | 1680 |
|
| 1582 |
/// \brief |
|
| 1681 |
/// \brief Returns a read-only FilterArcs adaptor |
|
| 1583 | 1682 |
/// |
| 1584 |
/// |
|
| 1683 |
/// This function just returns a read-only \ref FilterArcs adaptor. |
|
| 1684 |
/// \ingroup graph_adaptors |
|
| 1685 |
/// \relates FilterArcs |
|
| 1585 | 1686 |
template<typename Digraph, typename ArcFilterMap> |
| ... | ... |
@@ -1598,14 +1699,30 @@ |
| 1598 | 1699 |
/// |
| 1599 |
/// \brief |
|
| 1700 |
/// \brief Adaptor class for hiding edges in a graph. |
|
| 1600 | 1701 |
/// |
| 1601 |
/// FilterEdges adaptor hides edges in a digraph. A bool edge map must |
|
| 1602 |
/// be specified, which defines the filters for edges. Just the |
|
| 1603 |
/// unfiltered edges are shown in the subdigraph. The FilterEdges is |
|
| 1604 |
/// conform to the \ref concepts::Graph "Graph concept". |
|
| 1702 |
/// FilterEdges adaptor can be used for hiding edges in a graph. |
|
| 1703 |
/// A \c bool edge map must be specified, which defines the filter for |
|
| 1704 |
/// the edges. Only the edges with \c true filter value are shown in the |
|
| 1705 |
/// subgraph. This adaptor conforms to the \ref concepts::Graph |
|
| 1706 |
/// "Graph" concept. |
|
| 1605 | 1707 |
/// |
| 1606 |
/// \tparam _Graph It must be conform to the \ref concepts::Graph |
|
| 1607 |
/// "Graph concept". The type can be specified to be const. |
|
| 1608 |
/// \tparam _EdgeFilterMap A bool valued edge map of the the adapted |
|
| 1609 |
/// graph. |
|
| 1610 |
|
|
| 1708 |
/// The adapted graph can also be modified through this adaptor |
|
| 1709 |
/// by adding or removing nodes or edges, unless the \c _Graph template |
|
| 1710 |
/// parameter is set to be \c const. |
|
| 1711 |
/// |
|
| 1712 |
/// \tparam _Graph The type of the adapted graph. |
|
| 1713 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 1714 |
/// It can also be specified to be \c const. |
|
| 1715 |
/// \tparam _EdgeFilterMap A \c bool (or convertible) edge map of the |
|
| 1716 |
/// adapted graph. The default map type is |
|
| 1717 |
/// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>". |
|
| 1718 |
/// |
|
| 1719 |
/// \note The \c Node, \c Edge and \c Arc types of this adaptor and the |
|
| 1720 |
/// adapted graph are convertible to each other. |
|
| 1721 |
#ifdef DOXYGEN |
|
| 1722 |
template<typename _Graph, |
|
| 1723 |
typename _EdgeFilterMap> |
|
| 1724 |
#else |
|
| 1725 |
template<typename _Graph, |
|
| 1726 |
typename _EdgeFilterMap = typename _Graph::template EdgeMap<bool> > |
|
| 1727 |
#endif |
|
| 1611 | 1728 |
class FilterEdges : |
| ... | ... |
@@ -1630,7 +1747,7 @@ |
| 1630 | 1747 |
/// |
| 1631 |
/// Creates a FilterEdges adaptor for the given graph with |
|
| 1632 |
/// given edge map filters. |
|
| 1633 |
|
|
| 1748 |
/// Creates a subgraph for the given graph with the given edge |
|
| 1749 |
/// filter map. |
|
| 1750 |
FilterEdges(Graph& graph, EdgeFilterMap& edge_filter_map) : |
|
| 1634 | 1751 |
Parent(), const_true_map(true) {
|
| 1635 |
Parent::setGraph( |
|
| 1752 |
Parent::setGraph(graph); |
|
| 1636 | 1753 |
Parent::setNodeFilterMap(const_true_map); |
| ... | ... |
@@ -1639,20 +1756,20 @@ |
| 1639 | 1756 |
|
| 1640 |
/// \brief Hides the |
|
| 1757 |
/// \brief Hides the given edge |
|
| 1641 | 1758 |
/// |
| 1642 |
/// This function hides \c e in the graph, i.e. the iteration |
|
| 1643 |
/// jumps over it. This is done by simply setting the value of \c e |
|
| 1644 |
/// |
|
| 1759 |
/// This function hides the given edge in the subgraph, |
|
| 1760 |
/// i.e. the iteration jumps over it. |
|
| 1761 |
/// It is done by simply setting the assigned value of \c e |
|
| 1762 |
/// to be \c false in the edge filter map. |
|
| 1645 | 1763 |
void hide(const Edge& e) const { Parent::hide(e); }
|
| 1646 | 1764 |
|
| 1647 |
/// \brief |
|
| 1765 |
/// \brief Shows the given edge |
|
| 1648 | 1766 |
/// |
| 1649 |
/// The value of \c e is set to be true in the edge-map which stores |
|
| 1650 |
/// hide information. If \c e was hidden previuosly, then it is shown |
|
| 1651 |
/// |
|
| 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. |
|
| 1652 | 1770 |
void unHide(const Edge& e) const { Parent::unHide(e); }
|
| 1653 | 1771 |
|
| 1654 |
/// \brief Returns true if |
|
| 1772 |
/// \brief Returns \c true if the given edge is hidden. |
|
| 1655 | 1773 |
/// |
| 1656 |
/// Returns true if \c e is hidden. |
|
| 1657 |
/// |
|
| 1774 |
/// This function returns \c true if the given edge is hidden. |
|
| 1658 | 1775 |
bool hidden(const Edge& e) const { return Parent::hidden(e); }
|
| ... | ... |
@@ -1661,5 +1778,7 @@ |
| 1661 | 1778 |
|
| 1662 |
/// \brief |
|
| 1779 |
/// \brief Returns a read-only FilterEdges adaptor |
|
| 1663 | 1780 |
/// |
| 1664 |
/// |
|
| 1781 |
/// This function just returns a read-only \ref FilterEdges adaptor. |
|
| 1782 |
/// \ingroup graph_adaptors |
|
| 1783 |
/// \relates FilterEdges |
|
| 1665 | 1784 |
template<typename Graph, typename EdgeFilterMap> |
| ... | ... |
@@ -1676,2 +1795,3 @@ |
| 1676 | 1795 |
|
| 1796 |
|
|
| 1677 | 1797 |
template <typename _Digraph> |
| ... | ... |
@@ -1715,4 +1835,2 @@ |
| 1715 | 1835 |
|
| 1716 |
|
|
| 1717 |
|
|
| 1718 | 1836 |
void first(Node& n) const {
|
| ... | ... |
@@ -2070,12 +2188,23 @@ |
| 2070 | 2188 |
/// |
| 2071 |
/// \brief |
|
| 2189 |
/// \brief Adaptor class for viewing a digraph as an undirected graph. |
|
| 2072 | 2190 |
/// |
| 2073 |
/// This adaptor makes an undirected graph from a directed |
|
| 2074 |
/// graph. All arcs of the underlying digraph will be showed in the |
|
| 2075 |
/// adaptor as an edge. The Orienter adaptor is conform to the \ref |
|
| 2076 |
/// concepts::Graph "Graph concept". |
|
| 2191 |
/// Undirector adaptor can be used for viewing a digraph as an undirected |
|
| 2192 |
/// graph. All arcs of the underlying digraph are showed in the |
|
| 2193 |
/// adaptor as an edge (and also as a pair of arcs, of course). |
|
| 2194 |
/// This adaptor conforms to the \ref concepts::Graph "Graph" concept. |
|
| 2077 | 2195 |
/// |
| 2078 |
/// \tparam _Digraph It must be conform to the \ref |
|
| 2079 |
/// concepts::Digraph "Digraph concept". The type can be specified |
|
| 2080 |
/// |
|
| 2196 |
/// The adapted digraph can also be modified through this adaptor |
|
| 2197 |
/// by adding or removing nodes or edges, unless the \c _Digraph template |
|
| 2198 |
/// parameter is set to be \c const. |
|
| 2199 |
/// |
|
| 2200 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 2201 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 2202 |
/// It can also be specified to be \c const. |
|
| 2203 |
/// |
|
| 2204 |
/// \note The \c Node type of this adaptor and the adapted digraph are |
|
| 2205 |
/// convertible to each other, moreover the \c Edge type of the adaptor |
|
| 2206 |
/// and the \c Arc type of the adapted digraph are also convertible to |
|
| 2207 |
/// each other. |
|
| 2208 |
/// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type |
|
| 2209 |
/// of the adapted digraph.) |
|
| 2081 | 2210 |
template<typename _Digraph> |
| ... | ... |
@@ -2092,3 +2221,3 @@ |
| 2092 | 2221 |
/// |
| 2093 |
/// Creates |
|
| 2222 |
/// Creates an undirected graph from the given digraph. |
|
| 2094 | 2223 |
Undirector(_Digraph& digraph) {
|
| ... | ... |
@@ -2097,6 +2226,8 @@ |
| 2097 | 2226 |
|
| 2098 |
/// \brief |
|
| 2227 |
/// \brief Arc map combined from two original arc maps |
|
| 2099 | 2228 |
/// |
| 2100 |
/// This class adapts two original digraph ArcMap to |
|
| 2101 |
/// get an arc map on the undirected graph. |
|
| 2229 |
/// This map adaptor class adapts two arc maps of the underlying |
|
| 2230 |
/// digraph to get an arc map of the undirected graph. |
|
| 2231 |
/// Its value type is inherited from the first arc map type |
|
| 2232 |
/// (\c %ForwardMap). |
|
| 2102 | 2233 |
template <typename _ForwardMap, typename _BackwardMap> |
| ... | ... |
@@ -2110,4 +2241,6 @@ |
| 2110 | 2241 |
|
| 2242 |
/// The key type of the map |
|
| 2243 |
typedef typename Parent::Arc Key; |
|
| 2244 |
/// The value type of the map |
|
| 2111 | 2245 |
typedef typename ForwardMap::Value Value; |
| 2112 |
typedef typename Parent::Arc Key; |
|
| 2113 | 2246 |
|
| ... | ... |
@@ -2118,4 +2251,2 @@ |
| 2118 | 2251 |
|
| 2119 |
/// \brief Constructor |
|
| 2120 |
/// |
|
| 2121 | 2252 |
/// Constructor |
| ... | ... |
@@ -2124,6 +2255,3 @@ |
| 2124 | 2255 |
|
| 2125 |
|
|
| 2126 |
/// \brief Sets the value associated with a key. |
|
| 2127 |
/// |
|
| 2128 |
/// Sets the value associated with a key. |
|
| 2256 |
/// Sets the value associated with the given key. |
|
| 2129 | 2257 |
void set(const Key& e, const Value& a) {
|
| ... | ... |
@@ -2136,5 +2264,3 @@ |
| 2136 | 2264 |
|
| 2137 |
/// \brief Returns the value associated with a key. |
|
| 2138 |
/// |
|
| 2139 |
/// Returns the value associated with |
|
| 2265 |
/// Returns the value associated with the given key. |
|
| 2140 | 2266 |
ConstReturnValue operator[](const Key& e) const {
|
| ... | ... |
@@ -2147,5 +2273,3 @@ |
| 2147 | 2273 |
|
| 2148 |
/// \brief Returns the value associated with a key. |
|
| 2149 |
/// |
|
| 2150 |
/// Returns the value associated with |
|
| 2274 |
/// Returns a reference to the value associated with the given key. |
|
| 2151 | 2275 |
ReturnValue operator[](const Key& e) {
|
| ... | ... |
@@ -2165,5 +2289,5 @@ |
| 2165 | 2289 |
|
| 2166 |
/// \brief |
|
| 2290 |
/// \brief Returns a combined arc map |
|
| 2167 | 2291 |
/// |
| 2168 |
/// |
|
| 2292 |
/// This function just returns a combined arc map. |
|
| 2169 | 2293 |
template <typename ForwardMap, typename BackwardMap> |
| ... | ... |
@@ -2197,5 +2321,7 @@ |
| 2197 | 2321 |
|
| 2198 |
/// \brief |
|
| 2322 |
/// \brief Returns a read-only Undirector adaptor |
|
| 2199 | 2323 |
/// |
| 2200 |
/// |
|
| 2324 |
/// This function just returns a read-only \ref Undirector adaptor. |
|
| 2325 |
/// \ingroup graph_adaptors |
|
| 2326 |
/// \relates Undirector |
|
| 2201 | 2327 |
template<typename Digraph> |
| ... | ... |
@@ -2206,2 +2332,3 @@ |
| 2206 | 2332 |
|
| 2333 |
|
|
| 2207 | 2334 |
template <typename _Graph, typename _DirectionMap> |
| ... | ... |
@@ -2366,24 +2493,44 @@ |
| 2366 | 2493 |
/// |
| 2367 |
/// \brief |
|
| 2494 |
/// \brief Adaptor class for orienting the edges of a graph to get a digraph |
|
| 2368 | 2495 |
/// |
| 2369 |
/// This adaptor orients each edge in the undirected graph. The |
|
| 2370 |
/// direction of the arcs stored in an edge node map. The arcs can |
|
| 2371 |
/// be easily reverted by the \c reverseArc() member function in the |
|
| 2372 |
/// adaptor. The Orienter adaptor is conform to the \ref |
|
| 2373 |
/// |
|
| 2496 |
/// Orienter adaptor can be used for orienting the edges of a graph to |
|
| 2497 |
/// get a digraph. A \c bool edge map of the underlying graph must be |
|
| 2498 |
/// specified, which define the direction of the arcs in the adaptor. |
|
| 2499 |
/// The arcs can be easily reversed by the \c reverseArc() member function |
|
| 2500 |
/// of the adaptor. |
|
| 2501 |
/// This class conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 2374 | 2502 |
/// |
| 2375 |
/// \tparam _Graph It must be conform to the \ref concepts::Graph |
|
| 2376 |
/// "Graph concept". The type can be specified to be const. |
|
| 2377 |
/// \tparam _DirectionMap A bool valued edge map of the the adapted |
|
| 2378 |
/// graph. |
|
| 2503 |
/// The adapted graph can also be modified through this adaptor |
|
| 2504 |
/// by adding or removing nodes or arcs, unless the \c _Graph template |
|
| 2505 |
/// parameter is set to be \c const. |
|
| 2379 | 2506 |
/// |
| 2380 |
/// \ |
|
| 2507 |
/// \tparam _Graph The type of the adapted graph. |
|
| 2508 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 2509 |
/// It can also be specified to be \c const. |
|
| 2510 |
/// \tparam _DirectionMap A \c bool (or convertible) edge map of the |
|
| 2511 |
/// adapted graph. The default map type is |
|
| 2512 |
/// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>". |
|
| 2513 |
/// |
|
| 2514 |
/// \note The \c Node type of this adaptor and the adapted graph are |
|
| 2515 |
/// convertible to each other, moreover the \c Arc type of the adaptor |
|
| 2516 |
/// and the \c Edge type of the adapted graph are also convertible to |
|
| 2517 |
/// each other. |
|
| 2518 |
#ifdef DOXYGEN |
|
| 2381 | 2519 |
template<typename _Graph, |
| 2382 |
typename |
|
| 2520 |
typename _DirectionMap> |
|
| 2521 |
#else |
|
| 2522 |
template<typename _Graph, |
|
| 2523 |
typename _DirectionMap = typename _Graph::template EdgeMap<bool> > |
|
| 2524 |
#endif |
|
| 2383 | 2525 |
class Orienter : |
| 2384 |
public DigraphAdaptorExtender<OrienterBase<_Graph, |
|
| 2526 |
public DigraphAdaptorExtender<OrienterBase<_Graph, _DirectionMap> > {
|
|
| 2385 | 2527 |
public: |
| 2528 |
|
|
| 2529 |
/// The type of the adapted graph. |
|
| 2386 | 2530 |
typedef _Graph Graph; |
| 2531 |
/// The type of the direction edge map. |
|
| 2532 |
typedef _DirectionMap DirectionMap; |
|
| 2533 |
|
|
| 2387 | 2534 |
typedef DigraphAdaptorExtender< |
| 2388 |
OrienterBase<_Graph, |
|
| 2535 |
OrienterBase<_Graph, _DirectionMap> > Parent; |
|
| 2389 | 2536 |
typedef typename Parent::Arc Arc; |
| ... | ... |
@@ -2393,5 +2540,5 @@ |
| 2393 | 2540 |
|
| 2394 |
/// \brief Constructor |
|
| 2541 |
/// \brief Constructor |
|
| 2395 | 2542 |
/// |
| 2396 |
/// Constructor of the adaptor |
|
| 2543 |
/// Constructor of the adaptor. |
|
| 2397 | 2544 |
Orienter(Graph& graph, DirectionMap& direction) {
|
| ... | ... |
@@ -2401,5 +2548,7 @@ |
| 2401 | 2548 |
|
| 2402 |
/// \brief |
|
| 2549 |
/// \brief Reverses the given arc |
|
| 2403 | 2550 |
/// |
| 2404 |
/// |
|
| 2551 |
/// This function reverses the given arc. |
|
| 2552 |
/// It is done by simply negate the assigned value of \c a |
|
| 2553 |
/// in the direction map. |
|
| 2405 | 2554 |
void reverseArc(const Arc& a) {
|
| ... | ... |
@@ -2409,5 +2558,7 @@ |
| 2409 | 2558 |
|
| 2410 |
/// \brief |
|
| 2559 |
/// \brief Returns a read-only Orienter adaptor |
|
| 2411 | 2560 |
/// |
| 2412 |
/// |
|
| 2561 |
/// This function just returns a read-only \ref Orienter adaptor. |
|
| 2562 |
/// \ingroup graph_adaptors |
|
| 2563 |
/// \relates Orienter |
|
| 2413 | 2564 |
template<typename Graph, typename DirectionMap> |
| ... | ... |
@@ -2493,27 +2644,47 @@ |
| 2493 | 2644 |
/// |
| 2494 |
/// \brief |
|
| 2645 |
/// \brief Adaptor class for composing the residual digraph for directed |
|
| 2495 | 2646 |
/// flow and circulation problems. |
| 2496 | 2647 |
/// |
| 2497 |
/// An adaptor for composing the residual graph for directed flow and |
|
| 2498 |
/// circulation problems. Let \f$ G=(V, A) \f$ be a directed graph |
|
| 2499 |
/// and let \f$ F \f$ be a number type. Let moreover \f$ f,c:A\to F \f$, |
|
| 2500 |
/// be functions on the arc-set. |
|
| 2648 |
/// Residual can be used for composing the \e residual digraph for directed |
|
| 2649 |
/// flow and circulation problems. Let \f$ G=(V, A) \f$ be a directed graph |
|
| 2650 |
/// and let \f$ F \f$ be a number type. Let \f$ flow, cap: A\to F \f$ be |
|
| 2651 |
/// functions on the arcs. |
|
| 2652 |
/// This adaptor implements a digraph structure with node set \f$ V \f$ |
|
| 2653 |
/// and arc set \f$ A_{forward}\cup A_{backward} \f$,
|
|
| 2654 |
/// where \f$ A_{forward}=\{uv : uv\in A, flow(uv)<cap(uv)\} \f$ and
|
|
| 2655 |
/// \f$ A_{backward}=\{vu : uv\in A, flow(uv)>0\} \f$, i.e. the so
|
|
| 2656 |
/// called residual digraph. |
|
| 2657 |
/// When the union \f$ A_{forward}\cup A_{backward} \f$ is taken,
|
|
| 2658 |
/// multiplicities are counted, i.e. the adaptor has exactly |
|
| 2659 |
/// \f$ |A_{forward}| + |A_{backward}|\f$ arcs (it may have parallel
|
|
| 2660 |
/// arcs). |
|
| 2661 |
/// This class conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 2501 | 2662 |
/// |
| 2502 |
/// Then Residual implements the digraph structure with |
|
| 2503 |
/// node-set \f$ V \f$ and arc-set \f$ A_{forward}\cup A_{backward} \f$,
|
|
| 2504 |
/// where \f$ A_{forward}=\{uv : uv\in A, f(uv)<c(uv)\} \f$ and
|
|
| 2505 |
/// \f$ A_{backward}=\{vu : uv\in A, f(uv)>0\} \f$, i.e. the so
|
|
| 2506 |
/// called residual graph. When we take the union |
|
| 2507 |
/// \f$ A_{forward}\cup A_{backward} \f$, multiplicities are counted,
|
|
| 2508 |
/// i.e. if an arc is in both \f$ A_{forward} \f$ and
|
|
| 2509 |
/// \f$ A_{backward} \f$, then in the adaptor it appears in both
|
|
| 2510 |
/// |
|
| 2663 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 2664 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 2665 |
/// It is implicitly \c const. |
|
| 2666 |
/// \tparam _CapacityMap An arc map of some numerical type, which defines |
|
| 2667 |
/// the capacities in the flow problem. It is implicitly \c const. |
|
| 2668 |
/// The default map type is |
|
| 2669 |
/// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<int>". |
|
| 2670 |
/// \tparam _FlowMap An arc map of some numerical type, which defines |
|
| 2671 |
/// the flow values in the flow problem. |
|
| 2672 |
/// The default map type is \c _CapacityMap. |
|
| 2673 |
/// \tparam _Tolerance Tolerance type for handling inexact computation. |
|
| 2674 |
/// The default tolerance type depends on the value type of the |
|
| 2675 |
/// capacity map. |
|
| 2511 | 2676 |
/// |
| 2512 |
/// \tparam _Digraph It must be conform to the \ref concepts::Digraph |
|
| 2513 |
/// "Digraph concept". The type is implicitly const. |
|
| 2514 |
/// \tparam _CapacityMap An arc map of some numeric type, it defines |
|
| 2515 |
/// the capacities in the flow problem. The map is implicitly const. |
|
| 2516 |
/// \tparam _FlowMap An arc map of some numeric type, it defines |
|
| 2517 |
/// the capacities in the flow problem. |
|
| 2518 |
/// \ |
|
| 2677 |
/// \note This adaptor is implemented using Undirector and FilterArcs |
|
| 2678 |
/// adaptors. |
|
| 2679 |
/// |
|
| 2680 |
/// \note The \c Node type of this adaptor and the adapted digraph are |
|
| 2681 |
/// convertible to each other, moreover the \c Arc type of the adaptor |
|
| 2682 |
/// is convertible to the \c Arc type of the adapted digraph. |
|
| 2683 |
#ifdef DOXYGEN |
|
| 2684 |
template<typename _Digraph, |
|
| 2685 |
typename _CapacityMap, |
|
| 2686 |
typename _FlowMap, |
|
| 2687 |
typename _Tolerance> |
|
| 2688 |
class Residual |
|
| 2689 |
#else |
|
| 2519 | 2690 |
template<typename _Digraph, |
| ... | ... |
@@ -2530,2 +2701,3 @@ |
| 2530 | 2701 |
_FlowMap, _Tolerance> > > |
| 2702 |
#endif |
|
| 2531 | 2703 |
{
|
| ... | ... |
@@ -2533,4 +2705,7 @@ |
| 2533 | 2705 |
|
| 2706 |
/// The type of the underlying digraph. |
|
| 2534 | 2707 |
typedef _Digraph Digraph; |
| 2708 |
/// The type of the capacity map. |
|
| 2535 | 2709 |
typedef _CapacityMap CapacityMap; |
| 2710 |
/// The type of the flow map. |
|
| 2536 | 2711 |
typedef _FlowMap FlowMap; |
| ... | ... |
@@ -2566,6 +2741,6 @@ |
| 2566 | 2741 |
|
| 2567 |
/// \brief Constructor |
|
| 2742 |
/// \brief Constructor |
|
| 2568 | 2743 |
/// |
| 2569 |
/// Constructor of the residual graph. The parameters are the digraph, |
|
| 2570 |
/// the flow map, the capacity map and a tolerance object. |
|
| 2744 |
/// Constructor of the residual digraph adaptor. The parameters are the |
|
| 2745 |
/// digraph, the capacity map, the flow map, and a tolerance object. |
|
| 2571 | 2746 |
Residual(const Digraph& digraph, const CapacityMap& capacity, |
| ... | ... |
@@ -2583,5 +2758,5 @@ |
| 2583 | 2758 |
|
| 2584 |
/// \brief |
|
| 2759 |
/// \brief Returns the residual capacity of the given arc. |
|
| 2585 | 2760 |
/// |
| 2586 |
/// |
|
| 2761 |
/// Returns the residual capacity of the given arc. |
|
| 2587 | 2762 |
Value residualCapacity(const Arc& a) const {
|
| ... | ... |
@@ -2594,7 +2769,7 @@ |
| 2594 | 2769 |
|
| 2595 |
/// \brief Augment on the given arc in the residual |
|
| 2770 |
/// \brief Augment on the given arc in the residual digraph. |
|
| 2596 | 2771 |
/// |
| 2597 |
/// Augment on the given arc in the residual graph. It increase |
|
| 2598 |
/// or decrease the flow on the original arc depend on the direction |
|
| 2599 |
/// |
|
| 2772 |
/// Augment on the given arc in the residual digraph. It increases |
|
| 2773 |
/// or decreases the flow value on the original arc according to the |
|
| 2774 |
/// direction of the residual arc. |
|
| 2600 | 2775 |
void augment(const Arc& a, const Value& v) const {
|
| ... | ... |
@@ -2607,5 +2782,6 @@ |
| 2607 | 2782 |
|
| 2608 |
/// \brief Returns the |
|
| 2783 |
/// \brief Returns \c true if the given residual arc is a forward arc. |
|
| 2609 | 2784 |
/// |
| 2610 |
/// Returns true |
|
| 2785 |
/// Returns \c true if the given residual arc has the same orientation |
|
| 2786 |
/// as the original arc, i.e. it is a so called forward arc. |
|
| 2611 | 2787 |
static bool forward(const Arc& a) {
|
| ... | ... |
@@ -2614,5 +2790,6 @@ |
| 2614 | 2790 |
|
| 2615 |
/// \brief Returns the |
|
| 2791 |
/// \brief Returns \c true if the given residual arc is a backward arc. |
|
| 2616 | 2792 |
/// |
| 2617 |
/// Returns true |
|
| 2793 |
/// Returns \c true if the given residual arc has the opposite orientation |
|
| 2794 |
/// than the original arc, i.e. it is a so called backward arc. |
|
| 2618 | 2795 |
static bool backward(const Arc& a) {
|
| ... | ... |
@@ -2621,5 +2798,6 @@ |
| 2621 | 2798 |
|
| 2622 |
/// \brief |
|
| 2799 |
/// \brief Returns the forward oriented residual arc. |
|
| 2623 | 2800 |
/// |
| 2624 |
/// |
|
| 2801 |
/// Returns the forward oriented residual arc related to the given |
|
| 2802 |
/// arc of the underlying digraph. |
|
| 2625 | 2803 |
static Arc forward(const typename Digraph::Arc& a) {
|
| ... | ... |
@@ -2628,5 +2806,6 @@ |
| 2628 | 2806 |
|
| 2629 |
/// \brief |
|
| 2807 |
/// \brief Returns the backward oriented residual arc. |
|
| 2630 | 2808 |
/// |
| 2631 |
/// |
|
| 2809 |
/// Returns the backward oriented residual arc related to the given |
|
| 2810 |
/// arc of the underlying digraph. |
|
| 2632 | 2811 |
static Arc backward(const typename Digraph::Arc& a) {
|
| ... | ... |
@@ -2637,4 +2816,5 @@ |
| 2637 | 2816 |
/// |
| 2638 |
/// In generic residual graph the residual capacity can be obtained |
|
| 2639 |
/// as a map. |
|
| 2817 |
/// This map adaptor class can be used for obtaining the residual |
|
| 2818 |
/// capacities as an arc map of the residual digraph. |
|
| 2819 |
/// Its value type is inherited from the capacity map. |
|
| 2640 | 2820 |
class ResidualCapacity {
|
| ... | ... |
@@ -2643,5 +2823,5 @@ |
| 2643 | 2823 |
public: |
| 2644 |
/// The |
|
| 2824 |
/// The key type of the map |
|
| 2645 | 2825 |
typedef Arc Key; |
| 2646 |
/// The |
|
| 2826 |
/// The value type of the map |
|
| 2647 | 2827 |
typedef typename _CapacityMap::Value Value; |
| ... | ... |
@@ -2651,3 +2831,3 @@ |
| 2651 | 2831 |
|
| 2652 |
/// |
|
| 2832 |
/// Returns the value associated with the given residual arc |
|
| 2653 | 2833 |
Value operator[](const Arc& a) const {
|
| ... | ... |
@@ -3110,21 +3290,27 @@ |
| 3110 | 3290 |
/// |
| 3111 |
/// \brief |
|
| 3291 |
/// \brief Adaptor class for splitting the nodes of a digraph. |
|
| 3112 | 3292 |
/// |
| 3113 |
/// The SplitNodes adaptor splits each node into an in-node and an |
|
| 3114 |
/// out-node. Formaly, the adaptor replaces each \f$ u \f$ node in |
|
| 3115 |
/// the digraph with two nodes(namely node \f$ u_{in} \f$ and node
|
|
| 3116 |
/// \f$ u_{out} \f$). If there is a \f$ (v, u) \f$ arc in the
|
|
| 3117 |
/// original digraph the new target of the arc will be \f$ u_{in} \f$
|
|
| 3118 |
/// and similarly the source of the original \f$ (u, v) \f$ arc |
|
| 3119 |
/// will be \f$ u_{out} \f$. The adaptor will add for each node in
|
|
| 3120 |
/// the original digraph an additional arc which connects |
|
| 3121 |
/// |
|
| 3293 |
/// SplitNodes adaptor can be used for splitting each node into an |
|
| 3294 |
/// \e in-node and an \e out-node in a digraph. Formaly, the adaptor |
|
| 3295 |
/// replaces each node \f$ u \f$ in the digraph with two nodes, |
|
| 3296 |
/// namely node \f$ u_{in} \f$ and node \f$ u_{out} \f$.
|
|
| 3297 |
/// If there is a \f$ (v, u) \f$ arc in the original digraph, then the |
|
| 3298 |
/// new target of the arc will be \f$ u_{in} \f$ and similarly the
|
|
| 3299 |
/// source of each original \f$ (u, v) \f$ arc will be \f$ u_{out} \f$.
|
|
| 3300 |
/// The adaptor adds an additional \e bind \e arc from \f$ u_{in} \f$
|
|
| 3301 |
/// to \f$ u_{out} \f$ for each node \f$ u \f$ of the original digraph.
|
|
| 3122 | 3302 |
/// |
| 3123 |
/// The aim of this class is to run algorithm with node costs if the |
|
| 3124 |
/// algorithm can use directly just arc costs. In this case we should use |
|
| 3125 |
/// a \c SplitNodes and set the node cost of the graph to the |
|
| 3126 |
/// bind arc in the adapted graph. |
|
| 3303 |
/// The aim of this class is running an algorithm with respect to node |
|
| 3304 |
/// costs or capacities if the algorithm considers only arc costs or |
|
| 3305 |
/// capacities directly. |
|
| 3306 |
/// In this case you can use \c SplitNodes adaptor, and set the node |
|
| 3307 |
/// costs/capacities of the original digraph to the \e bind \e arcs |
|
| 3308 |
/// in the adaptor. |
|
| 3127 | 3309 |
/// |
| 3128 |
/// \tparam _Digraph It must be conform to the \ref concepts::Digraph |
|
| 3129 |
/// "Digraph concept". The type can be specified to be const. |
|
| 3310 |
/// \tparam _Digraph The type of the adapted digraph. |
|
| 3311 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 3312 |
/// It is implicitly \c const. |
|
| 3313 |
/// |
|
| 3314 |
/// \note The \c Node type of this adaptor is converible to the \c Node |
|
| 3315 |
/// type of the adapted digraph. |
|
| 3130 | 3316 |
template <typename _Digraph> |
| ... | ... |
@@ -3142,3 +3328,3 @@ |
| 3142 | 3328 |
|
| 3143 |
/// \brief Constructor |
|
| 3329 |
/// \brief Constructor |
|
| 3144 | 3330 |
/// |
| ... | ... |
@@ -3149,5 +3335,5 @@ |
| 3149 | 3335 |
|
| 3150 |
/// \brief Returns true |
|
| 3336 |
/// \brief Returns \c true if the given node is an in-node. |
|
| 3151 | 3337 |
/// |
| 3152 |
/// Returns true |
|
| 3338 |
/// Returns \c true if the given node is an in-node. |
|
| 3153 | 3339 |
static bool inNode(const Node& n) {
|
| ... | ... |
@@ -3156,5 +3342,5 @@ |
| 3156 | 3342 |
|
| 3157 |
/// \brief Returns true |
|
| 3343 |
/// \brief Returns \c true if the given node is an out-node. |
|
| 3158 | 3344 |
/// |
| 3159 |
/// Returns true |
|
| 3345 |
/// Returns \c true if the given node is an out-node. |
|
| 3160 | 3346 |
static bool outNode(const Node& n) {
|
| ... | ... |
@@ -3163,5 +3349,6 @@ |
| 3163 | 3349 |
|
| 3164 |
/// \brief Returns true |
|
| 3350 |
/// \brief Returns \c true if the given arc is an original arc. |
|
| 3165 | 3351 |
/// |
| 3166 |
/// Returns true |
|
| 3352 |
/// Returns \c true if the given arc is one of the arcs in the |
|
| 3353 |
/// original digraph. |
|
| 3167 | 3354 |
static bool origArc(const Arc& a) {
|
| ... | ... |
@@ -3170,5 +3357,6 @@ |
| 3170 | 3357 |
|
| 3171 |
/// \brief Returns true |
|
| 3358 |
/// \brief Returns \c true if the given arc is a bind arc. |
|
| 3172 | 3359 |
/// |
| 3173 |
/// Returns true |
|
| 3360 |
/// Returns \c true if the given arc is a bind arc, i.e. it connects |
|
| 3361 |
/// an in-node and an out-node. |
|
| 3174 | 3362 |
static bool bindArc(const Arc& a) {
|
| ... | ... |
@@ -3177,5 +3365,5 @@ |
| 3177 | 3365 |
|
| 3178 |
/// \brief |
|
| 3366 |
/// \brief Returns the in-node created from the given original node. |
|
| 3179 | 3367 |
/// |
| 3180 |
/// |
|
| 3368 |
/// Returns the in-node created from the given original node. |
|
| 3181 | 3369 |
static Node inNode(const DigraphNode& n) {
|
| ... | ... |
@@ -3184,5 +3372,5 @@ |
| 3184 | 3372 |
|
| 3185 |
/// \brief |
|
| 3373 |
/// \brief Returns the out-node created from the given original node. |
|
| 3186 | 3374 |
/// |
| 3187 |
/// |
|
| 3375 |
/// Returns the out-node created from the given original node. |
|
| 3188 | 3376 |
static Node outNode(const DigraphNode& n) {
|
| ... | ... |
@@ -3191,5 +3379,8 @@ |
| 3191 | 3379 |
|
| 3192 |
/// \brief |
|
| 3380 |
/// \brief Returns the bind arc that corresponds to the given |
|
| 3381 |
/// original node. |
|
| 3193 | 3382 |
/// |
| 3194 |
/// |
|
| 3383 |
/// Returns the bind arc in the adaptor that corresponds to the given |
|
| 3384 |
/// original node, i.e. the arc connecting the in-node and out-node |
|
| 3385 |
/// of \c n. |
|
| 3195 | 3386 |
static Arc arc(const DigraphNode& n) {
|
| ... | ... |
@@ -3198,5 +3389,6 @@ |
| 3198 | 3389 |
|
| 3199 |
/// \brief |
|
| 3390 |
/// \brief Returns the arc that corresponds to the given original arc. |
|
| 3200 | 3391 |
/// |
| 3201 |
/// |
|
| 3392 |
/// Returns the arc in the adaptor that corresponds to the given |
|
| 3393 |
/// original arc. |
|
| 3202 | 3394 |
static Arc arc(const DigraphArc& a) {
|
| ... | ... |
@@ -3205,6 +3397,8 @@ |
| 3205 | 3397 |
|
| 3206 |
/// \brief |
|
| 3398 |
/// \brief Node map combined from two original node maps |
|
| 3207 | 3399 |
/// |
| 3208 |
/// This class adapt two of the original digraph NodeMap to |
|
| 3209 |
/// get a node map on the adapted digraph. |
|
| 3400 |
/// This map adaptor class adapts two node maps of the original digraph |
|
| 3401 |
/// to get a node map of the split digraph. |
|
| 3402 |
/// Its value type is inherited from the first node map type |
|
| 3403 |
/// (\c InNodeMap). |
|
| 3210 | 3404 |
template <typename InNodeMap, typename OutNodeMap> |
| ... | ... |
@@ -3213,3 +3407,5 @@ |
| 3213 | 3407 |
|
| 3408 |
/// The key type of the map |
|
| 3214 | 3409 |
typedef Node Key; |
| 3410 |
/// The value type of the map |
|
| 3215 | 3411 |
typedef typename InNodeMap::Value Value; |
| ... | ... |
@@ -3222,5 +3418,3 @@ |
| 3222 | 3418 |
|
| 3223 |
/// \brief Constructor |
|
| 3224 |
/// |
|
| 3225 |
/// Constructor |
|
| 3419 |
/// Constructor |
|
| 3226 | 3420 |
CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) |
| ... | ... |
@@ -3228,5 +3422,12 @@ |
| 3228 | 3422 |
|
| 3229 |
/// \brief The subscript operator. |
|
| 3230 |
/// |
|
| 3231 |
/// |
|
| 3423 |
/// Returns the value associated with the given key. |
|
| 3424 |
Value operator[](const Key& key) const {
|
|
| 3425 |
if (Parent::inNode(key)) {
|
|
| 3426 |
return _in_map[key]; |
|
| 3427 |
} else {
|
|
| 3428 |
return _out_map[key]; |
|
| 3429 |
} |
|
| 3430 |
} |
|
| 3431 |
|
|
| 3432 |
/// Returns a reference to the value associated with the given key. |
|
| 3232 | 3433 |
Value& operator[](const Key& key) {
|
| ... | ... |
@@ -3239,16 +3440,3 @@ |
| 3239 | 3440 |
|
| 3240 |
/// \brief The const subscript operator. |
|
| 3241 |
/// |
|
| 3242 |
/// The const subscript operator. |
|
| 3243 |
Value operator[](const Key& key) const {
|
|
| 3244 |
if (Parent::inNode(key)) {
|
|
| 3245 |
return _in_map[key]; |
|
| 3246 |
} else {
|
|
| 3247 |
return _out_map[key]; |
|
| 3248 |
} |
|
| 3249 |
} |
|
| 3250 |
|
|
| 3251 |
/// \brief The setter function of the map. |
|
| 3252 |
/// |
|
| 3253 |
/// The setter function of the map. |
|
| 3441 |
/// Sets the value associated with the given key. |
|
| 3254 | 3442 |
void set(const Key& key, const Value& value) {
|
| ... | ... |
@@ -3269,5 +3457,5 @@ |
| 3269 | 3457 |
|
| 3270 |
/// \brief |
|
| 3458 |
/// \brief Returns a combined node map |
|
| 3271 | 3459 |
/// |
| 3272 |
/// |
|
| 3460 |
/// This function just returns a combined node map. |
|
| 3273 | 3461 |
template <typename InNodeMap, typename OutNodeMap> |
| ... | ... |
@@ -3297,6 +3485,9 @@ |
| 3297 | 3485 |
|
| 3298 |
/// \brief |
|
| 3486 |
/// \brief Arc map combined from an arc map and a node map of the |
|
| 3487 |
/// original digraph. |
|
| 3299 | 3488 |
/// |
| 3300 |
/// This class adapt an original ArcMap and a NodeMap to get an |
|
| 3301 |
/// arc map on the adapted digraph |
|
| 3489 |
/// This map adaptor class adapts an arc map and a node map of the |
|
| 3490 |
/// original digraph to get an arc map of the split digraph. |
|
| 3491 |
/// Its value type is inherited from the original arc map type |
|
| 3492 |
/// (\c DigraphArcMap). |
|
| 3302 | 3493 |
template <typename DigraphArcMap, typename DigraphNodeMap> |
| ... | ... |
@@ -3305,3 +3496,5 @@ |
| 3305 | 3496 |
|
| 3497 |
/// The key type of the map |
|
| 3306 | 3498 |
typedef Arc Key; |
| 3499 |
/// The value type of the map |
|
| 3307 | 3500 |
typedef typename DigraphArcMap::Value Value; |
| ... | ... |
@@ -3319,5 +3512,3 @@ |
| 3319 | 3512 |
|
| 3320 |
/// \brief Constructor |
|
| 3321 |
/// |
|
| 3322 |
/// Constructor |
|
| 3513 |
/// Constructor |
|
| 3323 | 3514 |
CombinedArcMap(DigraphArcMap& arc_map, DigraphNodeMap& node_map) |
| ... | ... |
@@ -3325,5 +3516,21 @@ |
| 3325 | 3516 |
|
| 3326 |
/// \brief The subscript operator. |
|
| 3327 |
/// |
|
| 3328 |
/// |
|
| 3517 |
/// Returns the value associated with the given key. |
|
| 3518 |
Value operator[](const Key& arc) const {
|
|
| 3519 |
if (Parent::origArc(arc)) {
|
|
| 3520 |
return _arc_map[arc]; |
|
| 3521 |
} else {
|
|
| 3522 |
return _node_map[arc]; |
|
| 3523 |
} |
|
| 3524 |
} |
|
| 3525 |
|
|
| 3526 |
/// Returns a reference to the value associated with the given key. |
|
| 3527 |
Value& operator[](const Key& arc) {
|
|
| 3528 |
if (Parent::origArc(arc)) {
|
|
| 3529 |
return _arc_map[arc]; |
|
| 3530 |
} else {
|
|
| 3531 |
return _node_map[arc]; |
|
| 3532 |
} |
|
| 3533 |
} |
|
| 3534 |
|
|
| 3535 |
/// Sets the value associated with the given key. |
|
| 3329 | 3536 |
void set(const Arc& arc, const Value& val) {
|
| ... | ... |
@@ -3336,24 +3543,2 @@ |
| 3336 | 3543 |
|
| 3337 |
/// \brief The const subscript operator. |
|
| 3338 |
/// |
|
| 3339 |
/// The const subscript operator. |
|
| 3340 |
Value operator[](const Key& arc) const {
|
|
| 3341 |
if (Parent::origArc(arc)) {
|
|
| 3342 |
return _arc_map[arc]; |
|
| 3343 |
} else {
|
|
| 3344 |
return _node_map[arc]; |
|
| 3345 |
} |
|
| 3346 |
} |
|
| 3347 |
|
|
| 3348 |
/// \brief The const subscript operator. |
|
| 3349 |
/// |
|
| 3350 |
/// The const subscript operator. |
|
| 3351 |
Value& operator[](const Key& arc) {
|
|
| 3352 |
if (Parent::origArc(arc)) {
|
|
| 3353 |
return _arc_map[arc]; |
|
| 3354 |
} else {
|
|
| 3355 |
return _node_map[arc]; |
|
| 3356 |
} |
|
| 3357 |
} |
|
| 3358 |
|
|
| 3359 | 3544 |
private: |
| ... | ... |
@@ -3363,5 +3548,5 @@ |
| 3363 | 3548 |
|
| 3364 |
/// \brief |
|
| 3549 |
/// \brief Returns a combined arc map |
|
| 3365 | 3550 |
/// |
| 3366 |
/// |
|
| 3551 |
/// This function just returns a combined arc map. |
|
| 3367 | 3552 |
template <typename DigraphArcMap, typename DigraphNodeMap> |
| ... | ... |
@@ -3396,5 +3581,7 @@ |
| 3396 | 3581 |
|
| 3397 |
/// \brief |
|
| 3582 |
/// \brief Returns a (read-only) SplitNodes adaptor |
|
| 3398 | 3583 |
/// |
| 3399 |
/// |
|
| 3584 |
/// This function just returns a (read-only) \ref SplitNodes adaptor. |
|
| 3585 |
/// \ingroup graph_adaptors |
|
| 3586 |
/// \relates SplitNodes |
|
| 3400 | 3587 |
template<typename Digraph> |
0 comments (0 inline)