1.1 --- a/lemon/adaptors.h Fri Jan 09 14:03:25 2009 +0100
1.2 +++ b/lemon/adaptors.h Sun Jan 11 15:24:20 2009 +0100
1.3 @@ -353,22 +353,26 @@
1.4 /// It conforms to the \ref concepts::Digraph "Digraph" concept.
1.5 ///
1.6 /// The adapted digraph can also be modified through this adaptor
1.7 - /// by adding or removing nodes or arcs, unless the \c _Digraph template
1.8 + /// by adding or removing nodes or arcs, unless the \c GR template
1.9 /// parameter is set to be \c const.
1.10 ///
1.11 - /// \tparam _Digraph The type of the adapted digraph.
1.12 + /// \tparam GR The type of the adapted digraph.
1.13 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.14 /// It can also be specified to be \c const.
1.15 ///
1.16 /// \note The \c Node and \c Arc types of this adaptor and the adapted
1.17 /// digraph are convertible to each other.
1.18 - template<typename _Digraph>
1.19 + template<typename GR>
1.20 +#ifdef DOXYGEN
1.21 + class ReverseDigraph {
1.22 +#else
1.23 class ReverseDigraph :
1.24 - public DigraphAdaptorExtender<ReverseDigraphBase<_Digraph> > {
1.25 + public DigraphAdaptorExtender<ReverseDigraphBase<GR> > {
1.26 +#endif
1.27 public:
1.28 - typedef _Digraph Digraph;
1.29 - typedef DigraphAdaptorExtender<
1.30 - ReverseDigraphBase<_Digraph> > Parent;
1.31 + /// The type of the adapted digraph.
1.32 + typedef GR Digraph;
1.33 + typedef DigraphAdaptorExtender<ReverseDigraphBase<GR> > Parent;
1.34 protected:
1.35 ReverseDigraph() { }
1.36 public:
1.37 @@ -386,9 +390,9 @@
1.38 /// This function just returns a read-only \ref ReverseDigraph adaptor.
1.39 /// \ingroup graph_adaptors
1.40 /// \relates ReverseDigraph
1.41 - template<typename Digraph>
1.42 - ReverseDigraph<const Digraph> reverseDigraph(const Digraph& digraph) {
1.43 - return ReverseDigraph<const Digraph>(digraph);
1.44 + template<typename GR>
1.45 + ReverseDigraph<const GR> reverseDigraph(const GR& digraph) {
1.46 + return ReverseDigraph<const GR>(digraph);
1.47 }
1.48
1.49
1.50 @@ -696,28 +700,25 @@
1.51 /// A \c bool node map and a \c bool arc map must be specified, which
1.52 /// define the filters for nodes and arcs.
1.53 /// Only the nodes and arcs with \c true filter value are
1.54 - /// shown in the subdigraph. This adaptor conforms to the \ref
1.55 - /// concepts::Digraph "Digraph" concept. If the \c _checked parameter
1.56 - /// is \c true, then the arcs incident to hidden nodes are also
1.57 - /// filtered out.
1.58 + /// shown in the subdigraph. The arcs that are incident to hidden
1.59 + /// nodes are also filtered out.
1.60 + /// This adaptor conforms to the \ref concepts::Digraph "Digraph" concept.
1.61 ///
1.62 /// The adapted digraph can also be modified through this adaptor
1.63 - /// by adding or removing nodes or arcs, unless the \c _Digraph template
1.64 + /// by adding or removing nodes or arcs, unless the \c GR template
1.65 /// parameter is set to be \c const.
1.66 ///
1.67 - /// \tparam _Digraph The type of the adapted digraph.
1.68 + /// \tparam GR The type of the adapted digraph.
1.69 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.70 /// It can also be specified to be \c const.
1.71 - /// \tparam _NodeFilterMap A \c bool (or convertible) node map of the
1.72 - /// adapted digraph. The default map type is
1.73 - /// \ref concepts::Digraph::NodeMap "_Digraph::NodeMap<bool>".
1.74 - /// \tparam _ArcFilterMap A \c bool (or convertible) arc map of the
1.75 - /// adapted digraph. The default map type is
1.76 - /// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<bool>".
1.77 - /// \tparam _checked If this parameter is set to \c false, then the arc
1.78 - /// filtering is not checked with respect to the node filter.
1.79 - /// Otherwise, each arc that is incident to a hidden node is automatically
1.80 - /// filtered out. This is the default option.
1.81 + /// \tparam NF The type of the node filter map.
1.82 + /// It must be a \c bool (or convertible) node map of the
1.83 + /// adapted digraph. The default type is
1.84 + /// \ref concepts::Digraph::NodeMap "GR::NodeMap<bool>".
1.85 + /// \tparam AF The type of the arc filter map.
1.86 + /// It must be \c bool (or convertible) arc map of the
1.87 + /// adapted digraph. The default type is
1.88 + /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
1.89 ///
1.90 /// \note The \c Node and \c Arc types of this adaptor and the adapted
1.91 /// digraph are convertible to each other.
1.92 @@ -725,30 +726,25 @@
1.93 /// \see FilterNodes
1.94 /// \see FilterArcs
1.95 #ifdef DOXYGEN
1.96 - template<typename _Digraph,
1.97 - typename _NodeFilterMap,
1.98 - typename _ArcFilterMap,
1.99 - bool _checked>
1.100 + template<typename GR, typename NF, typename AF>
1.101 + class SubDigraph {
1.102 #else
1.103 - template<typename _Digraph,
1.104 - typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>,
1.105 - typename _ArcFilterMap = typename _Digraph::template ArcMap<bool>,
1.106 - bool _checked = true>
1.107 + template<typename GR,
1.108 + typename NF = typename GR::template NodeMap<bool>,
1.109 + typename AF = typename GR::template ArcMap<bool> >
1.110 + class SubDigraph :
1.111 + public DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> > {
1.112 #endif
1.113 - class SubDigraph
1.114 - : public DigraphAdaptorExtender<
1.115 - SubDigraphBase<_Digraph, _NodeFilterMap, _ArcFilterMap, _checked> > {
1.116 public:
1.117 /// The type of the adapted digraph.
1.118 - typedef _Digraph Digraph;
1.119 + typedef GR Digraph;
1.120 /// The type of the node filter map.
1.121 - typedef _NodeFilterMap NodeFilterMap;
1.122 + typedef NF NodeFilterMap;
1.123 /// The type of the arc filter map.
1.124 - typedef _ArcFilterMap ArcFilterMap;
1.125 -
1.126 - typedef DigraphAdaptorExtender<
1.127 - SubDigraphBase<_Digraph, _NodeFilterMap, _ArcFilterMap, _checked> >
1.128 - Parent;
1.129 + typedef AF ArcFilterMap;
1.130 +
1.131 + typedef DigraphAdaptorExtender<SubDigraphBase<GR, NF, AF, true> >
1.132 + Parent;
1.133
1.134 typedef typename Parent::Node Node;
1.135 typedef typename Parent::Arc Arc;
1.136 @@ -827,35 +823,36 @@
1.137 /// This function just returns a read-only \ref SubDigraph adaptor.
1.138 /// \ingroup graph_adaptors
1.139 /// \relates SubDigraph
1.140 - template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
1.141 - SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap>
1.142 - subDigraph(const Digraph& digraph, NodeFilterMap& nfm, ArcFilterMap& afm) {
1.143 - return SubDigraph<const Digraph, NodeFilterMap, ArcFilterMap>
1.144 - (digraph, nfm, afm);
1.145 + template<typename GR, typename NF, typename AF>
1.146 + SubDigraph<const GR, NF, AF>
1.147 + subDigraph(const GR& digraph,
1.148 + NF& node_filter_map, AF& arc_filter_map) {
1.149 + return SubDigraph<const GR, NF, AF>
1.150 + (digraph, node_filter_map, arc_filter_map);
1.151 }
1.152
1.153 - template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
1.154 - SubDigraph<const Digraph, const NodeFilterMap, ArcFilterMap>
1.155 - subDigraph(const Digraph& digraph,
1.156 - const NodeFilterMap& nfm, ArcFilterMap& afm) {
1.157 - return SubDigraph<const Digraph, const NodeFilterMap, ArcFilterMap>
1.158 - (digraph, nfm, afm);
1.159 + template<typename GR, typename NF, typename AF>
1.160 + SubDigraph<const GR, const NF, AF>
1.161 + subDigraph(const GR& digraph,
1.162 + const NF& node_filter_map, AF& arc_filter_map) {
1.163 + return SubDigraph<const GR, const NF, AF>
1.164 + (digraph, node_filter_map, arc_filter_map);
1.165 }
1.166
1.167 - template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
1.168 - SubDigraph<const Digraph, NodeFilterMap, const ArcFilterMap>
1.169 - subDigraph(const Digraph& digraph,
1.170 - NodeFilterMap& nfm, const ArcFilterMap& afm) {
1.171 - return SubDigraph<const Digraph, NodeFilterMap, const ArcFilterMap>
1.172 - (digraph, nfm, afm);
1.173 + template<typename GR, typename NF, typename AF>
1.174 + SubDigraph<const GR, NF, const AF>
1.175 + subDigraph(const GR& digraph,
1.176 + NF& node_filter_map, const AF& arc_filter_map) {
1.177 + return SubDigraph<const GR, NF, const AF>
1.178 + (digraph, node_filter_map, arc_filter_map);
1.179 }
1.180
1.181 - template<typename Digraph, typename NodeFilterMap, typename ArcFilterMap>
1.182 - SubDigraph<const Digraph, const NodeFilterMap, const ArcFilterMap>
1.183 - subDigraph(const Digraph& digraph,
1.184 - const NodeFilterMap& nfm, const ArcFilterMap& afm) {
1.185 - return SubDigraph<const Digraph, const NodeFilterMap,
1.186 - const ArcFilterMap>(digraph, nfm, afm);
1.187 + template<typename GR, typename NF, typename AF>
1.188 + SubDigraph<const GR, const NF, const AF>
1.189 + subDigraph(const GR& digraph,
1.190 + const NF& node_filter_map, const AF& arc_filter_map) {
1.191 + return SubDigraph<const GR, const NF, const AF>
1.192 + (digraph, node_filter_map, arc_filter_map);
1.193 }
1.194
1.195
1.196 @@ -1292,28 +1289,25 @@
1.197 /// A \c bool node map and a \c bool edge map must be specified, which
1.198 /// define the filters for nodes and edges.
1.199 /// Only the nodes and edges with \c true filter value are
1.200 - /// shown in the subgraph. This adaptor conforms to the \ref
1.201 - /// concepts::Graph "Graph" concept. If the \c _checked parameter is
1.202 - /// \c true, then the edges incident to hidden nodes are also
1.203 - /// filtered out.
1.204 + /// shown in the subgraph. The edges that are incident to hidden
1.205 + /// nodes are also filtered out.
1.206 + /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
1.207 ///
1.208 /// The adapted graph can also be modified through this adaptor
1.209 - /// by adding or removing nodes or edges, unless the \c _Graph template
1.210 + /// by adding or removing nodes or edges, unless the \c GR template
1.211 /// parameter is set to be \c const.
1.212 ///
1.213 - /// \tparam _Graph The type of the adapted graph.
1.214 + /// \tparam GR The type of the adapted graph.
1.215 /// It must conform to the \ref concepts::Graph "Graph" concept.
1.216 /// It can also be specified to be \c const.
1.217 - /// \tparam _NodeFilterMap A \c bool (or convertible) node map of the
1.218 - /// adapted graph. The default map type is
1.219 - /// \ref concepts::Graph::NodeMap "_Graph::NodeMap<bool>".
1.220 - /// \tparam _EdgeFilterMap A \c bool (or convertible) edge map of the
1.221 - /// adapted graph. The default map type is
1.222 - /// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>".
1.223 - /// \tparam _checked If this parameter is set to \c false, then the edge
1.224 - /// filtering is not checked with respect to the node filter.
1.225 - /// Otherwise, each edge that is incident to a hidden node is automatically
1.226 - /// filtered out. This is the default option.
1.227 + /// \tparam NF The type of the node filter map.
1.228 + /// It must be a \c bool (or convertible) node map of the
1.229 + /// adapted graph. The default type is
1.230 + /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
1.231 + /// \tparam EF The type of the edge filter map.
1.232 + /// It must be a \c bool (or convertible) edge map of the
1.233 + /// adapted graph. The default type is
1.234 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
1.235 ///
1.236 /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
1.237 /// adapted graph are convertible to each other.
1.238 @@ -1321,29 +1315,25 @@
1.239 /// \see FilterNodes
1.240 /// \see FilterEdges
1.241 #ifdef DOXYGEN
1.242 - template<typename _Graph,
1.243 - typename _NodeFilterMap,
1.244 - typename _EdgeFilterMap,
1.245 - bool _checked>
1.246 + template<typename GR, typename NF, typename EF>
1.247 + class SubGraph {
1.248 #else
1.249 - template<typename _Graph,
1.250 - typename _NodeFilterMap = typename _Graph::template NodeMap<bool>,
1.251 - typename _EdgeFilterMap = typename _Graph::template EdgeMap<bool>,
1.252 - bool _checked = true>
1.253 + template<typename GR,
1.254 + typename NF = typename GR::template NodeMap<bool>,
1.255 + typename EF = typename GR::template EdgeMap<bool> >
1.256 + class SubGraph :
1.257 + public GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> > {
1.258 #endif
1.259 - class SubGraph
1.260 - : public GraphAdaptorExtender<
1.261 - SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, _checked> > {
1.262 public:
1.263 /// The type of the adapted graph.
1.264 - typedef _Graph Graph;
1.265 + typedef GR Graph;
1.266 /// The type of the node filter map.
1.267 - typedef _NodeFilterMap NodeFilterMap;
1.268 + typedef NF NodeFilterMap;
1.269 /// The type of the edge filter map.
1.270 - typedef _EdgeFilterMap EdgeFilterMap;
1.271 -
1.272 - typedef GraphAdaptorExtender<
1.273 - SubGraphBase<_Graph, _NodeFilterMap, _EdgeFilterMap, _checked> > Parent;
1.274 + typedef EF EdgeFilterMap;
1.275 +
1.276 + typedef GraphAdaptorExtender< SubGraphBase<GR, NF, EF, true> >
1.277 + Parent;
1.278
1.279 typedef typename Parent::Node Node;
1.280 typedef typename Parent::Edge Edge;
1.281 @@ -1422,34 +1412,36 @@
1.282 /// This function just returns a read-only \ref SubGraph adaptor.
1.283 /// \ingroup graph_adaptors
1.284 /// \relates SubGraph
1.285 - template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
1.286 - SubGraph<const Graph, NodeFilterMap, ArcFilterMap>
1.287 - subGraph(const Graph& graph, NodeFilterMap& nfm, ArcFilterMap& efm) {
1.288 - return SubGraph<const Graph, NodeFilterMap, ArcFilterMap>(graph, nfm, efm);
1.289 + template<typename GR, typename NF, typename EF>
1.290 + SubGraph<const GR, NF, EF>
1.291 + subGraph(const GR& graph,
1.292 + NF& node_filter_map, EF& edge_filter_map) {
1.293 + return SubGraph<const GR, NF, EF>
1.294 + (graph, node_filter_map, edge_filter_map);
1.295 }
1.296
1.297 - template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
1.298 - SubGraph<const Graph, const NodeFilterMap, ArcFilterMap>
1.299 - subGraph(const Graph& graph,
1.300 - const NodeFilterMap& nfm, ArcFilterMap& efm) {
1.301 - return SubGraph<const Graph, const NodeFilterMap, ArcFilterMap>
1.302 - (graph, nfm, efm);
1.303 + template<typename GR, typename NF, typename EF>
1.304 + SubGraph<const GR, const NF, EF>
1.305 + subGraph(const GR& graph,
1.306 + const NF& node_filter_map, EF& edge_filter_map) {
1.307 + return SubGraph<const GR, const NF, EF>
1.308 + (graph, node_filter_map, edge_filter_map);
1.309 }
1.310
1.311 - template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
1.312 - SubGraph<const Graph, NodeFilterMap, const ArcFilterMap>
1.313 - subGraph(const Graph& graph,
1.314 - NodeFilterMap& nfm, const ArcFilterMap& efm) {
1.315 - return SubGraph<const Graph, NodeFilterMap, const ArcFilterMap>
1.316 - (graph, nfm, efm);
1.317 + template<typename GR, typename NF, typename EF>
1.318 + SubGraph<const GR, NF, const EF>
1.319 + subGraph(const GR& graph,
1.320 + NF& node_filter_map, const EF& edge_filter_map) {
1.321 + return SubGraph<const GR, NF, const EF>
1.322 + (graph, node_filter_map, edge_filter_map);
1.323 }
1.324
1.325 - template<typename Graph, typename NodeFilterMap, typename ArcFilterMap>
1.326 - SubGraph<const Graph, const NodeFilterMap, const ArcFilterMap>
1.327 - subGraph(const Graph& graph,
1.328 - const NodeFilterMap& nfm, const ArcFilterMap& efm) {
1.329 - return SubGraph<const Graph, const NodeFilterMap, const ArcFilterMap>
1.330 - (graph, nfm, efm);
1.331 + template<typename GR, typename NF, typename EF>
1.332 + SubGraph<const GR, const NF, const EF>
1.333 + subGraph(const GR& graph,
1.334 + const NF& node_filter_map, const EF& edge_filter_map) {
1.335 + return SubGraph<const GR, const NF, const EF>
1.336 + (graph, node_filter_map, edge_filter_map);
1.337 }
1.338
1.339
1.340 @@ -1463,48 +1455,42 @@
1.341 /// arcs/edges incident to nodes both with \c true filter value are shown
1.342 /// in the subgraph. This adaptor conforms to the \ref concepts::Digraph
1.343 /// "Digraph" concept or the \ref concepts::Graph "Graph" concept
1.344 - /// depending on the \c _Graph template parameter.
1.345 + /// depending on the \c GR template parameter.
1.346 ///
1.347 /// The adapted (di)graph can also be modified through this adaptor
1.348 - /// by adding or removing nodes or arcs/edges, unless the \c _Graph template
1.349 + /// by adding or removing nodes or arcs/edges, unless the \c GR template
1.350 /// parameter is set to be \c const.
1.351 ///
1.352 - /// \tparam _Graph The type of the adapted digraph or graph.
1.353 + /// \tparam GR The type of the adapted digraph or graph.
1.354 /// It must conform to the \ref concepts::Digraph "Digraph" concept
1.355 /// or the \ref concepts::Graph "Graph" concept.
1.356 /// It can also be specified to be \c const.
1.357 - /// \tparam _NodeFilterMap A \c bool (or convertible) node map of the
1.358 - /// adapted (di)graph. The default map type is
1.359 - /// \ref concepts::Graph::NodeMap "_Graph::NodeMap<bool>".
1.360 - /// \tparam _checked If this parameter is set to \c false then the arc/edge
1.361 - /// filtering is not checked with respect to the node filter. In this
1.362 - /// case only isolated nodes can be filtered out from the graph.
1.363 - /// Otherwise, each arc/edge that is incident to a hidden node is
1.364 - /// automatically filtered out. This is the default option.
1.365 + /// \tparam NF The type of the node filter map.
1.366 + /// It must be a \c bool (or convertible) node map of the
1.367 + /// adapted (di)graph. The default type is
1.368 + /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
1.369 ///
1.370 /// \note The \c Node and <tt>Arc/Edge</tt> types of this adaptor and the
1.371 /// adapted (di)graph are convertible to each other.
1.372 #ifdef DOXYGEN
1.373 - template<typename _Graph,
1.374 - typename _NodeFilterMap,
1.375 - bool _checked>
1.376 + template<typename GR, typename NF>
1.377 + class FilterNodes {
1.378 #else
1.379 - template<typename _Digraph,
1.380 - typename _NodeFilterMap = typename _Digraph::template NodeMap<bool>,
1.381 - bool _checked = true,
1.382 + template<typename GR,
1.383 + typename NF = typename GR::template NodeMap<bool>,
1.384 typename Enable = void>
1.385 + class FilterNodes :
1.386 + public DigraphAdaptorExtender<
1.387 + SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> > {
1.388 #endif
1.389 - class FilterNodes
1.390 - : public SubDigraph<_Digraph, _NodeFilterMap,
1.391 - ConstMap<typename _Digraph::Arc, bool>, _checked> {
1.392 public:
1.393
1.394 - typedef _Digraph Digraph;
1.395 - typedef _NodeFilterMap NodeFilterMap;
1.396 -
1.397 - typedef SubDigraph<Digraph, NodeFilterMap,
1.398 - ConstMap<typename Digraph::Arc, bool>, _checked>
1.399 - Parent;
1.400 + typedef GR Digraph;
1.401 + typedef NF NodeFilterMap;
1.402 +
1.403 + typedef DigraphAdaptorExtender<
1.404 + SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, bool>, true> >
1.405 + Parent;
1.406
1.407 typedef typename Parent::Node Node;
1.408
1.409 @@ -1521,12 +1507,9 @@
1.410 ///
1.411 /// Creates a subgraph for the given digraph or graph with the
1.412 /// given node filter map.
1.413 -#ifdef DOXYGEN
1.414 - FilterNodes(_Graph& graph, _NodeFilterMap& node_filter) :
1.415 -#else
1.416 - FilterNodes(Digraph& graph, NodeFilterMap& node_filter) :
1.417 -#endif
1.418 - Parent(), const_true_map(true) {
1.419 + FilterNodes(GR& graph, NodeFilterMap& node_filter) :
1.420 + Parent(), const_true_map(true)
1.421 + {
1.422 Parent::setDigraph(graph);
1.423 Parent::setNodeFilterMap(node_filter);
1.424 Parent::setArcFilterMap(const_true_map);
1.425 @@ -1560,16 +1543,18 @@
1.426
1.427 };
1.428
1.429 - template<typename _Graph, typename _NodeFilterMap, bool _checked>
1.430 - class FilterNodes<_Graph, _NodeFilterMap, _checked,
1.431 - typename enable_if<UndirectedTagIndicator<_Graph> >::type>
1.432 - : public SubGraph<_Graph, _NodeFilterMap,
1.433 - ConstMap<typename _Graph::Edge, bool>, _checked> {
1.434 + template<typename GR, typename NF>
1.435 + class FilterNodes<GR, NF,
1.436 + typename enable_if<UndirectedTagIndicator<GR> >::type> :
1.437 + public GraphAdaptorExtender<
1.438 + SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> > {
1.439 +
1.440 public:
1.441 - typedef _Graph Graph;
1.442 - typedef _NodeFilterMap NodeFilterMap;
1.443 - typedef SubGraph<Graph, NodeFilterMap,
1.444 - ConstMap<typename Graph::Edge, bool> > Parent;
1.445 + typedef GR Graph;
1.446 + typedef NF NodeFilterMap;
1.447 + typedef GraphAdaptorExtender<
1.448 + SubGraphBase<GR, NF, ConstMap<typename GR::Edge, bool>, true> >
1.449 + Parent;
1.450
1.451 typedef typename Parent::Node Node;
1.452 protected:
1.453 @@ -1601,16 +1586,16 @@
1.454 /// This function just returns a read-only \ref FilterNodes adaptor.
1.455 /// \ingroup graph_adaptors
1.456 /// \relates FilterNodes
1.457 - template<typename Digraph, typename NodeFilterMap>
1.458 - FilterNodes<const Digraph, NodeFilterMap>
1.459 - filterNodes(const Digraph& digraph, NodeFilterMap& nfm) {
1.460 - return FilterNodes<const Digraph, NodeFilterMap>(digraph, nfm);
1.461 + template<typename GR, typename NF>
1.462 + FilterNodes<const GR, NF>
1.463 + filterNodes(const GR& graph, NF& node_filter_map) {
1.464 + return FilterNodes<const GR, NF>(graph, node_filter_map);
1.465 }
1.466
1.467 - template<typename Digraph, typename NodeFilterMap>
1.468 - FilterNodes<const Digraph, const NodeFilterMap>
1.469 - filterNodes(const Digraph& digraph, const NodeFilterMap& nfm) {
1.470 - return FilterNodes<const Digraph, const NodeFilterMap>(digraph, nfm);
1.471 + template<typename GR, typename NF>
1.472 + FilterNodes<const GR, const NF>
1.473 + filterNodes(const GR& graph, const NF& node_filter_map) {
1.474 + return FilterNodes<const GR, const NF>(graph, node_filter_map);
1.475 }
1.476
1.477 /// \ingroup graph_adaptors
1.478 @@ -1624,35 +1609,39 @@
1.479 /// "Digraph" concept.
1.480 ///
1.481 /// The adapted digraph can also be modified through this adaptor
1.482 - /// by adding or removing nodes or arcs, unless the \c _Digraph template
1.483 + /// by adding or removing nodes or arcs, unless the \c GR template
1.484 /// parameter is set to be \c const.
1.485 ///
1.486 - /// \tparam _Digraph The type of the adapted digraph.
1.487 + /// \tparam GR The type of the adapted digraph.
1.488 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.489 /// It can also be specified to be \c const.
1.490 - /// \tparam _ArcFilterMap A \c bool (or convertible) arc map of the
1.491 - /// adapted digraph. The default map type is
1.492 - /// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<bool>".
1.493 + /// \tparam AF The type of the arc filter map.
1.494 + /// It must be a \c bool (or convertible) arc map of the
1.495 + /// adapted digraph. The default type is
1.496 + /// \ref concepts::Digraph::ArcMap "GR::ArcMap<bool>".
1.497 ///
1.498 /// \note The \c Node and \c Arc types of this adaptor and the adapted
1.499 /// digraph are convertible to each other.
1.500 #ifdef DOXYGEN
1.501 - template<typename _Digraph,
1.502 - typename _ArcFilterMap>
1.503 + template<typename GR,
1.504 + typename AF>
1.505 + class FilterArcs {
1.506 #else
1.507 - template<typename _Digraph,
1.508 - typename _ArcFilterMap = typename _Digraph::template ArcMap<bool> >
1.509 + template<typename GR,
1.510 + typename AF = typename GR::template ArcMap<bool> >
1.511 + class FilterArcs :
1.512 + public DigraphAdaptorExtender<
1.513 + SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> > {
1.514 #endif
1.515 - class FilterArcs :
1.516 - public SubDigraph<_Digraph, ConstMap<typename _Digraph::Node, bool>,
1.517 - _ArcFilterMap, false> {
1.518 public:
1.519 -
1.520 - typedef _Digraph Digraph;
1.521 - typedef _ArcFilterMap ArcFilterMap;
1.522 -
1.523 - typedef SubDigraph<Digraph, ConstMap<typename Digraph::Node, bool>,
1.524 - ArcFilterMap, false> Parent;
1.525 + /// The type of the adapted digraph.
1.526 + typedef GR Digraph;
1.527 + /// The type of the arc filter map.
1.528 + typedef AF ArcFilterMap;
1.529 +
1.530 + typedef DigraphAdaptorExtender<
1.531 + SubDigraphBase<GR, ConstMap<typename GR::Node, bool>, AF, false> >
1.532 + Parent;
1.533
1.534 typedef typename Parent::Arc Arc;
1.535
1.536 @@ -1709,16 +1698,16 @@
1.537 /// This function just returns a read-only \ref FilterArcs adaptor.
1.538 /// \ingroup graph_adaptors
1.539 /// \relates FilterArcs
1.540 - template<typename Digraph, typename ArcFilterMap>
1.541 - FilterArcs<const Digraph, ArcFilterMap>
1.542 - filterArcs(const Digraph& digraph, ArcFilterMap& afm) {
1.543 - return FilterArcs<const Digraph, ArcFilterMap>(digraph, afm);
1.544 + template<typename GR, typename AF>
1.545 + FilterArcs<const GR, AF>
1.546 + filterArcs(const GR& digraph, AF& arc_filter_map) {
1.547 + return FilterArcs<const GR, AF>(digraph, arc_filter_map);
1.548 }
1.549
1.550 - template<typename Digraph, typename ArcFilterMap>
1.551 - FilterArcs<const Digraph, const ArcFilterMap>
1.552 - filterArcs(const Digraph& digraph, const ArcFilterMap& afm) {
1.553 - return FilterArcs<const Digraph, const ArcFilterMap>(digraph, afm);
1.554 + template<typename GR, typename AF>
1.555 + FilterArcs<const GR, const AF>
1.556 + filterArcs(const GR& digraph, const AF& arc_filter_map) {
1.557 + return FilterArcs<const GR, const AF>(digraph, arc_filter_map);
1.558 }
1.559
1.560 /// \ingroup graph_adaptors
1.561 @@ -1732,34 +1721,42 @@
1.562 /// "Graph" concept.
1.563 ///
1.564 /// The adapted graph can also be modified through this adaptor
1.565 - /// by adding or removing nodes or edges, unless the \c _Graph template
1.566 + /// by adding or removing nodes or edges, unless the \c GR template
1.567 /// parameter is set to be \c const.
1.568 ///
1.569 - /// \tparam _Graph The type of the adapted graph.
1.570 + /// \tparam GR The type of the adapted graph.
1.571 /// It must conform to the \ref concepts::Graph "Graph" concept.
1.572 /// It can also be specified to be \c const.
1.573 - /// \tparam _EdgeFilterMap A \c bool (or convertible) edge map of the
1.574 - /// adapted graph. The default map type is
1.575 - /// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>".
1.576 + /// \tparam EF The type of the edge filter map.
1.577 + /// It must be a \c bool (or convertible) edge map of the
1.578 + /// adapted graph. The default type is
1.579 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
1.580 ///
1.581 /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
1.582 /// adapted graph are convertible to each other.
1.583 #ifdef DOXYGEN
1.584 - template<typename _Graph,
1.585 - typename _EdgeFilterMap>
1.586 + template<typename GR,
1.587 + typename EF>
1.588 + class FilterEdges {
1.589 #else
1.590 - template<typename _Graph,
1.591 - typename _EdgeFilterMap = typename _Graph::template EdgeMap<bool> >
1.592 + template<typename GR,
1.593 + typename EF = typename GR::template EdgeMap<bool> >
1.594 + class FilterEdges :
1.595 + public GraphAdaptorExtender<
1.596 + SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> > {
1.597 #endif
1.598 - class FilterEdges :
1.599 - public SubGraph<_Graph, ConstMap<typename _Graph::Node,bool>,
1.600 - _EdgeFilterMap, false> {
1.601 public:
1.602 - typedef _Graph Graph;
1.603 - typedef _EdgeFilterMap EdgeFilterMap;
1.604 - typedef SubGraph<Graph, ConstMap<typename Graph::Node,bool>,
1.605 - EdgeFilterMap, false> Parent;
1.606 + /// The type of the adapted graph.
1.607 + typedef GR Graph;
1.608 + /// The type of the edge filter map.
1.609 + typedef EF EdgeFilterMap;
1.610 +
1.611 + typedef GraphAdaptorExtender<
1.612 + SubGraphBase<GR, ConstMap<typename GR::Node,bool>, EF, false> >
1.613 + Parent;
1.614 +
1.615 typedef typename Parent::Edge Edge;
1.616 +
1.617 protected:
1.618 ConstMap<typename Graph::Node, bool> const_true_map;
1.619
1.620 @@ -1813,16 +1810,16 @@
1.621 /// This function just returns a read-only \ref FilterEdges adaptor.
1.622 /// \ingroup graph_adaptors
1.623 /// \relates FilterEdges
1.624 - template<typename Graph, typename EdgeFilterMap>
1.625 - FilterEdges<const Graph, EdgeFilterMap>
1.626 - filterEdges(const Graph& graph, EdgeFilterMap& efm) {
1.627 - return FilterEdges<const Graph, EdgeFilterMap>(graph, efm);
1.628 + template<typename GR, typename EF>
1.629 + FilterEdges<const GR, EF>
1.630 + filterEdges(const GR& graph, EF& edge_filter_map) {
1.631 + return FilterEdges<const GR, EF>(graph, edge_filter_map);
1.632 }
1.633
1.634 - template<typename Graph, typename EdgeFilterMap>
1.635 - FilterEdges<const Graph, const EdgeFilterMap>
1.636 - filterEdges(const Graph& graph, const EdgeFilterMap& efm) {
1.637 - return FilterEdges<const Graph, const EdgeFilterMap>(graph, efm);
1.638 + template<typename GR, typename EF>
1.639 + FilterEdges<const GR, const EF>
1.640 + filterEdges(const GR& graph, const EF& edge_filter_map) {
1.641 + return FilterEdges<const GR, const EF>(graph, edge_filter_map);
1.642 }
1.643
1.644
1.645 @@ -2226,10 +2223,10 @@
1.646 /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
1.647 ///
1.648 /// The adapted digraph can also be modified through this adaptor
1.649 - /// by adding or removing nodes or edges, unless the \c _Digraph template
1.650 + /// by adding or removing nodes or edges, unless the \c GR template
1.651 /// parameter is set to be \c const.
1.652 ///
1.653 - /// \tparam _Digraph The type of the adapted digraph.
1.654 + /// \tparam GR The type of the adapted digraph.
1.655 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.656 /// It can also be specified to be \c const.
1.657 ///
1.658 @@ -2239,12 +2236,17 @@
1.659 /// each other.
1.660 /// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type
1.661 /// of the adapted digraph.)
1.662 - template<typename _Digraph>
1.663 - class Undirector
1.664 - : public GraphAdaptorExtender<UndirectorBase<_Digraph> > {
1.665 + template<typename GR>
1.666 +#ifdef DOXYGEN
1.667 + class Undirector {
1.668 +#else
1.669 + class Undirector :
1.670 + public GraphAdaptorExtender<UndirectorBase<GR> > {
1.671 +#endif
1.672 public:
1.673 - typedef _Digraph Digraph;
1.674 - typedef GraphAdaptorExtender<UndirectorBase<Digraph> > Parent;
1.675 + /// The type of the adapted digraph.
1.676 + typedef GR Digraph;
1.677 + typedef GraphAdaptorExtender<UndirectorBase<GR> > Parent;
1.678 protected:
1.679 Undirector() { }
1.680 public:
1.681 @@ -2252,7 +2254,7 @@
1.682 /// \brief Constructor
1.683 ///
1.684 /// Creates an undirected graph from the given digraph.
1.685 - Undirector(_Digraph& digraph) {
1.686 + Undirector(Digraph& digraph) {
1.687 setDigraph(digraph);
1.688 }
1.689
1.690 @@ -2262,20 +2264,17 @@
1.691 /// digraph to get an arc map of the undirected graph.
1.692 /// Its value type is inherited from the first arc map type
1.693 /// (\c %ForwardMap).
1.694 - template <typename _ForwardMap, typename _BackwardMap>
1.695 + template <typename ForwardMap, typename BackwardMap>
1.696 class CombinedArcMap {
1.697 public:
1.698
1.699 - typedef _ForwardMap ForwardMap;
1.700 - typedef _BackwardMap BackwardMap;
1.701 -
1.702 - typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
1.703 -
1.704 /// The key type of the map
1.705 typedef typename Parent::Arc Key;
1.706 /// The value type of the map
1.707 typedef typename ForwardMap::Value Value;
1.708
1.709 + typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
1.710 +
1.711 typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue;
1.712 typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue;
1.713 typedef typename MapTraits<ForwardMap>::ReturnValue Reference;
1.714 @@ -2356,10 +2355,9 @@
1.715 /// This function just returns a read-only \ref Undirector adaptor.
1.716 /// \ingroup graph_adaptors
1.717 /// \relates Undirector
1.718 - template<typename Digraph>
1.719 - Undirector<const Digraph>
1.720 - undirector(const Digraph& digraph) {
1.721 - return Undirector<const Digraph>(digraph);
1.722 + template<typename GR>
1.723 + Undirector<const GR> undirector(const GR& digraph) {
1.724 + return Undirector<const GR>(digraph);
1.725 }
1.726
1.727
1.728 @@ -2533,38 +2531,39 @@
1.729 /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
1.730 ///
1.731 /// The adapted graph can also be modified through this adaptor
1.732 - /// by adding or removing nodes or arcs, unless the \c _Graph template
1.733 + /// by adding or removing nodes or arcs, unless the \c GR template
1.734 /// parameter is set to be \c const.
1.735 ///
1.736 - /// \tparam _Graph The type of the adapted graph.
1.737 + /// \tparam GR The type of the adapted graph.
1.738 /// It must conform to the \ref concepts::Graph "Graph" concept.
1.739 /// It can also be specified to be \c const.
1.740 - /// \tparam _DirectionMap A \c bool (or convertible) edge map of the
1.741 - /// adapted graph. The default map type is
1.742 - /// \ref concepts::Graph::EdgeMap "_Graph::EdgeMap<bool>".
1.743 + /// \tparam DM The type of the direction map.
1.744 + /// It must be a \c bool (or convertible) edge map of the
1.745 + /// adapted graph. The default type is
1.746 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
1.747 ///
1.748 /// \note The \c Node type of this adaptor and the adapted graph are
1.749 /// convertible to each other, moreover the \c Arc type of the adaptor
1.750 /// and the \c Edge type of the adapted graph are also convertible to
1.751 /// each other.
1.752 #ifdef DOXYGEN
1.753 - template<typename _Graph,
1.754 - typename _DirectionMap>
1.755 + template<typename GR,
1.756 + typename DM>
1.757 + class Orienter {
1.758 #else
1.759 - template<typename _Graph,
1.760 - typename _DirectionMap = typename _Graph::template EdgeMap<bool> >
1.761 + template<typename GR,
1.762 + typename DM = typename GR::template EdgeMap<bool> >
1.763 + class Orienter :
1.764 + public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
1.765 #endif
1.766 - class Orienter :
1.767 - public DigraphAdaptorExtender<OrienterBase<_Graph, _DirectionMap> > {
1.768 public:
1.769
1.770 /// The type of the adapted graph.
1.771 - typedef _Graph Graph;
1.772 + typedef GR Graph;
1.773 /// The type of the direction edge map.
1.774 - typedef _DirectionMap DirectionMap;
1.775 -
1.776 - typedef DigraphAdaptorExtender<
1.777 - OrienterBase<_Graph, _DirectionMap> > Parent;
1.778 + typedef DM DirectionMap;
1.779 +
1.780 + typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
1.781 typedef typename Parent::Arc Arc;
1.782 protected:
1.783 Orienter() { }
1.784 @@ -2593,32 +2592,27 @@
1.785 /// This function just returns a read-only \ref Orienter adaptor.
1.786 /// \ingroup graph_adaptors
1.787 /// \relates Orienter
1.788 - template<typename Graph, typename DirectionMap>
1.789 - Orienter<const Graph, DirectionMap>
1.790 - orienter(const Graph& graph, DirectionMap& dm) {
1.791 - return Orienter<const Graph, DirectionMap>(graph, dm);
1.792 + template<typename GR, typename DM>
1.793 + Orienter<const GR, DM>
1.794 + orienter(const GR& graph, DM& direction_map) {
1.795 + return Orienter<const GR, DM>(graph, direction_map);
1.796 }
1.797
1.798 - template<typename Graph, typename DirectionMap>
1.799 - Orienter<const Graph, const DirectionMap>
1.800 - orienter(const Graph& graph, const DirectionMap& dm) {
1.801 - return Orienter<const Graph, const DirectionMap>(graph, dm);
1.802 + template<typename GR, typename DM>
1.803 + Orienter<const GR, const DM>
1.804 + orienter(const GR& graph, const DM& direction_map) {
1.805 + return Orienter<const GR, const DM>(graph, direction_map);
1.806 }
1.807
1.808 namespace _adaptor_bits {
1.809
1.810 - template<typename _Digraph,
1.811 - typename _CapacityMap = typename _Digraph::template ArcMap<int>,
1.812 - typename _FlowMap = _CapacityMap,
1.813 - typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
1.814 + template<typename Digraph,
1.815 + typename CapacityMap,
1.816 + typename FlowMap,
1.817 + typename Tolerance>
1.818 class ResForwardFilter {
1.819 public:
1.820
1.821 - typedef _Digraph Digraph;
1.822 - typedef _CapacityMap CapacityMap;
1.823 - typedef _FlowMap FlowMap;
1.824 - typedef _Tolerance Tolerance;
1.825 -
1.826 typedef typename Digraph::Arc Key;
1.827 typedef bool Value;
1.828
1.829 @@ -2638,18 +2632,13 @@
1.830 }
1.831 };
1.832
1.833 - template<typename _Digraph,
1.834 - typename _CapacityMap = typename _Digraph::template ArcMap<int>,
1.835 - typename _FlowMap = _CapacityMap,
1.836 - typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
1.837 + template<typename Digraph,
1.838 + typename CapacityMap,
1.839 + typename FlowMap,
1.840 + typename Tolerance>
1.841 class ResBackwardFilter {
1.842 public:
1.843
1.844 - typedef _Digraph Digraph;
1.845 - typedef _CapacityMap CapacityMap;
1.846 - typedef _FlowMap FlowMap;
1.847 - typedef _Tolerance Tolerance;
1.848 -
1.849 typedef typename Digraph::Arc Key;
1.850 typedef bool Value;
1.851
1.852 @@ -2692,17 +2681,18 @@
1.853 /// arcs).
1.854 /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
1.855 ///
1.856 - /// \tparam _Digraph The type of the adapted digraph.
1.857 + /// \tparam GR The type of the adapted digraph.
1.858 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.859 /// It is implicitly \c const.
1.860 - /// \tparam _CapacityMap An arc map of some numerical type, which defines
1.861 + /// \tparam CM The type of the capacity map.
1.862 + /// It must be an arc map of some numerical type, which defines
1.863 /// the capacities in the flow problem. It is implicitly \c const.
1.864 - /// The default map type is
1.865 - /// \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<int>".
1.866 - /// \tparam _FlowMap An arc map of some numerical type, which defines
1.867 - /// the flow values in the flow problem.
1.868 - /// The default map type is \c _CapacityMap.
1.869 - /// \tparam _Tolerance Tolerance type for handling inexact computation.
1.870 + /// The default type is
1.871 + /// \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
1.872 + /// \tparam FM The type of the flow map.
1.873 + /// It must be an arc map of some numerical type, which defines
1.874 + /// the flow values in the flow problem. The default type is \c CM.
1.875 + /// \tparam TL The tolerance type for handling inexact computation.
1.876 /// The default tolerance type depends on the value type of the
1.877 /// capacity map.
1.878 ///
1.879 @@ -2713,35 +2703,31 @@
1.880 /// convertible to each other, moreover the \c Arc type of the adaptor
1.881 /// is convertible to the \c Arc type of the adapted digraph.
1.882 #ifdef DOXYGEN
1.883 - template<typename _Digraph,
1.884 - typename _CapacityMap,
1.885 - typename _FlowMap,
1.886 - typename _Tolerance>
1.887 + template<typename GR, typename CM, typename FM, typename TL>
1.888 class Residual
1.889 #else
1.890 - template<typename _Digraph,
1.891 - typename _CapacityMap = typename _Digraph::template ArcMap<int>,
1.892 - typename _FlowMap = _CapacityMap,
1.893 - typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
1.894 + template<typename GR,
1.895 + typename CM = typename GR::template ArcMap<int>,
1.896 + typename FM = CM,
1.897 + typename TL = Tolerance<typename CM::Value> >
1.898 class Residual :
1.899 public FilterArcs<
1.900 - Undirector<const _Digraph>,
1.901 - typename Undirector<const _Digraph>::template CombinedArcMap<
1.902 - _adaptor_bits::ResForwardFilter<const _Digraph, _CapacityMap,
1.903 - _FlowMap, _Tolerance>,
1.904 - _adaptor_bits::ResBackwardFilter<const _Digraph, _CapacityMap,
1.905 - _FlowMap, _Tolerance> > >
1.906 + Undirector<const GR>,
1.907 + typename Undirector<const GR>::template CombinedArcMap<
1.908 + _adaptor_bits::ResForwardFilter<const GR, CM, FM, TL>,
1.909 + _adaptor_bits::ResBackwardFilter<const GR, CM, FM, TL> > >
1.910 #endif
1.911 {
1.912 public:
1.913
1.914 /// The type of the underlying digraph.
1.915 - typedef _Digraph Digraph;
1.916 + typedef GR Digraph;
1.917 /// The type of the capacity map.
1.918 - typedef _CapacityMap CapacityMap;
1.919 + typedef CM CapacityMap;
1.920 /// The type of the flow map.
1.921 - typedef _FlowMap FlowMap;
1.922 - typedef _Tolerance Tolerance;
1.923 + typedef FM FlowMap;
1.924 + /// The tolerance type.
1.925 + typedef TL Tolerance;
1.926
1.927 typedef typename CapacityMap::Value Value;
1.928 typedef Residual Adaptor;
1.929 @@ -2757,7 +2743,7 @@
1.930 FlowMap, Tolerance> BackwardFilter;
1.931
1.932 typedef typename Undirected::
1.933 - template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
1.934 + template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
1.935
1.936 typedef FilterArcs<Undirected, ArcFilter> Parent;
1.937
1.938 @@ -2856,7 +2842,7 @@
1.939 /// The key type of the map
1.940 typedef Arc Key;
1.941 /// The value type of the map
1.942 - typedef typename _CapacityMap::Value Value;
1.943 + typedef typename CapacityMap::Value Value;
1.944
1.945 /// Constructor
1.946 ResidualCapacity(const Adaptor& adaptor) : _adaptor(&adaptor) {}
1.947 @@ -2882,13 +2868,11 @@
1.948 /// This function just returns a (read-only) \ref Residual adaptor.
1.949 /// \ingroup graph_adaptors
1.950 /// \relates Residual
1.951 - template<typename Digraph, typename CapacityMap, typename FlowMap>
1.952 - Residual<Digraph, CapacityMap, FlowMap>
1.953 - residual(const Digraph& digraph,
1.954 - const CapacityMap& capacity,
1.955 - FlowMap& flow)
1.956 - {
1.957 - return Residual<Digraph, CapacityMap, FlowMap> (digraph, capacity, flow);
1.958 + template<typename GR, typename CM, typename FM>
1.959 + Residual<GR, CM, FM> residual(const GR& digraph,
1.960 + const CM& capacity_map,
1.961 + FM& flow_map) {
1.962 + return Residual<GR, CM, FM> (digraph, capacity_map, flow_map);
1.963 }
1.964
1.965
1.966 @@ -3339,18 +3323,22 @@
1.967 /// costs/capacities of the original digraph to the \e bind \e arcs
1.968 /// in the adaptor.
1.969 ///
1.970 - /// \tparam _Digraph The type of the adapted digraph.
1.971 + /// \tparam GR The type of the adapted digraph.
1.972 /// It must conform to the \ref concepts::Digraph "Digraph" concept.
1.973 /// It is implicitly \c const.
1.974 ///
1.975 /// \note The \c Node type of this adaptor is converible to the \c Node
1.976 /// type of the adapted digraph.
1.977 - template <typename _Digraph>
1.978 + template <typename GR>
1.979 +#ifdef DOXYGEN
1.980 + class SplitNodes {
1.981 +#else
1.982 class SplitNodes
1.983 - : public DigraphAdaptorExtender<SplitNodesBase<const _Digraph> > {
1.984 + : public DigraphAdaptorExtender<SplitNodesBase<const GR> > {
1.985 +#endif
1.986 public:
1.987 - typedef _Digraph Digraph;
1.988 - typedef DigraphAdaptorExtender<SplitNodesBase<const Digraph> > Parent;
1.989 + typedef GR Digraph;
1.990 + typedef DigraphAdaptorExtender<SplitNodesBase<const GR> > Parent;
1.991
1.992 typedef typename Digraph::Node DigraphNode;
1.993 typedef typename Digraph::Arc DigraphArc;
1.994 @@ -3521,29 +3509,24 @@
1.995 /// This map adaptor class adapts an arc map and a node map of the
1.996 /// original digraph to get an arc map of the split digraph.
1.997 /// Its value type is inherited from the original arc map type
1.998 - /// (\c DigraphArcMap).
1.999 - template <typename DigraphArcMap, typename DigraphNodeMap>
1.1000 + /// (\c ArcMap).
1.1001 + template <typename ArcMap, typename NodeMap>
1.1002 class CombinedArcMap {
1.1003 public:
1.1004
1.1005 /// The key type of the map
1.1006 typedef Arc Key;
1.1007 /// The value type of the map
1.1008 - typedef typename DigraphArcMap::Value Value;
1.1009 -
1.1010 - typedef typename MapTraits<DigraphArcMap>::ReferenceMapTag
1.1011 - ReferenceMapTag;
1.1012 - typedef typename MapTraits<DigraphArcMap>::ReturnValue
1.1013 - ReturnValue;
1.1014 - typedef typename MapTraits<DigraphArcMap>::ConstReturnValue
1.1015 - ConstReturnValue;
1.1016 - typedef typename MapTraits<DigraphArcMap>::ReturnValue
1.1017 - Reference;
1.1018 - typedef typename MapTraits<DigraphArcMap>::ConstReturnValue
1.1019 - ConstReference;
1.1020 + typedef typename ArcMap::Value Value;
1.1021 +
1.1022 + typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag;
1.1023 + typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue;
1.1024 + typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue;
1.1025 + typedef typename MapTraits<ArcMap>::ReturnValue Reference;
1.1026 + typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReference;
1.1027
1.1028 /// Constructor
1.1029 - CombinedArcMap(DigraphArcMap& arc_map, DigraphNodeMap& node_map)
1.1030 + CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
1.1031 : _arc_map(arc_map), _node_map(node_map) {}
1.1032
1.1033 /// Returns the value associated with the given key.
1.1034 @@ -3574,39 +3557,35 @@
1.1035 }
1.1036
1.1037 private:
1.1038 - DigraphArcMap& _arc_map;
1.1039 - DigraphNodeMap& _node_map;
1.1040 + ArcMap& _arc_map;
1.1041 + NodeMap& _node_map;
1.1042 };
1.1043
1.1044 /// \brief Returns a combined arc map
1.1045 ///
1.1046 /// This function just returns a combined arc map.
1.1047 - template <typename DigraphArcMap, typename DigraphNodeMap>
1.1048 - static CombinedArcMap<DigraphArcMap, DigraphNodeMap>
1.1049 - combinedArcMap(DigraphArcMap& arc_map, DigraphNodeMap& node_map) {
1.1050 - return CombinedArcMap<DigraphArcMap, DigraphNodeMap>(arc_map, node_map);
1.1051 + template <typename ArcMap, typename NodeMap>
1.1052 + static CombinedArcMap<ArcMap, NodeMap>
1.1053 + combinedArcMap(ArcMap& arc_map, NodeMap& node_map) {
1.1054 + return CombinedArcMap<ArcMap, NodeMap>(arc_map, node_map);
1.1055 }
1.1056
1.1057 - template <typename DigraphArcMap, typename DigraphNodeMap>
1.1058 - static CombinedArcMap<const DigraphArcMap, DigraphNodeMap>
1.1059 - combinedArcMap(const DigraphArcMap& arc_map, DigraphNodeMap& node_map) {
1.1060 - return CombinedArcMap<const DigraphArcMap,
1.1061 - DigraphNodeMap>(arc_map, node_map);
1.1062 + template <typename ArcMap, typename NodeMap>
1.1063 + static CombinedArcMap<const ArcMap, NodeMap>
1.1064 + combinedArcMap(const ArcMap& arc_map, NodeMap& node_map) {
1.1065 + return CombinedArcMap<const ArcMap, NodeMap>(arc_map, node_map);
1.1066 }
1.1067
1.1068 - template <typename DigraphArcMap, typename DigraphNodeMap>
1.1069 - static CombinedArcMap<DigraphArcMap, const DigraphNodeMap>
1.1070 - combinedArcMap(DigraphArcMap& arc_map, const DigraphNodeMap& node_map) {
1.1071 - return CombinedArcMap<DigraphArcMap,
1.1072 - const DigraphNodeMap>(arc_map, node_map);
1.1073 + template <typename ArcMap, typename NodeMap>
1.1074 + static CombinedArcMap<ArcMap, const NodeMap>
1.1075 + combinedArcMap(ArcMap& arc_map, const NodeMap& node_map) {
1.1076 + return CombinedArcMap<ArcMap, const NodeMap>(arc_map, node_map);
1.1077 }
1.1078
1.1079 - template <typename DigraphArcMap, typename DigraphNodeMap>
1.1080 - static CombinedArcMap<const DigraphArcMap, const DigraphNodeMap>
1.1081 - combinedArcMap(const DigraphArcMap& arc_map,
1.1082 - const DigraphNodeMap& node_map) {
1.1083 - return CombinedArcMap<const DigraphArcMap,
1.1084 - const DigraphNodeMap>(arc_map, node_map);
1.1085 + template <typename ArcMap, typename NodeMap>
1.1086 + static CombinedArcMap<const ArcMap, const NodeMap>
1.1087 + combinedArcMap(const ArcMap& arc_map, const NodeMap& node_map) {
1.1088 + return CombinedArcMap<const ArcMap, const NodeMap>(arc_map, node_map);
1.1089 }
1.1090
1.1091 };
1.1092 @@ -3616,13 +3595,12 @@
1.1093 /// This function just returns a (read-only) \ref SplitNodes adaptor.
1.1094 /// \ingroup graph_adaptors
1.1095 /// \relates SplitNodes
1.1096 - template<typename Digraph>
1.1097 - SplitNodes<Digraph>
1.1098 - splitNodes(const Digraph& digraph) {
1.1099 - return SplitNodes<Digraph>(digraph);
1.1100 + template<typename GR>
1.1101 + SplitNodes<GR>
1.1102 + splitNodes(const GR& digraph) {
1.1103 + return SplitNodes<GR>(digraph);
1.1104 }
1.1105
1.1106 -
1.1107 } //namespace lemon
1.1108
1.1109 #endif //LEMON_ADAPTORS_H
2.1 --- a/lemon/bits/graph_adaptor_extender.h Fri Jan 09 14:03:25 2009 +0100
2.2 +++ b/lemon/bits/graph_adaptor_extender.h Sun Jan 11 15:24:20 2009 +0100
2.3 @@ -173,10 +173,6 @@
2.4
2.5 };
2.6
2.7 -
2.8 - /// \ingroup digraphbits
2.9 - ///
2.10 - /// \brief Extender for the GraphAdaptors
2.11 template <typename _Graph>
2.12 class GraphAdaptorExtender : public _Graph {
2.13 public: