# HG changeset patch # User marci # Date 1096308687 0 # Node ID 5a89cacf17f10439e9069b5921c67c72d47a55bb # Parent 6a22e0dfd45307170a239ad492e77816b5ba6308 minor corrections diff -r 6a22e0dfd453 -r 5a89cacf17f1 src/hugo/graph_wrapper.h --- a/src/hugo/graph_wrapper.h Sun Sep 26 21:43:38 2004 +0000 +++ b/src/hugo/graph_wrapper.h Mon Sep 27 18:11:27 2004 +0000 @@ -27,6 +27,7 @@ #include #include +#include #include namespace hugo { @@ -314,7 +315,7 @@ /// /// This wrapper shows a graph with filtered node-set and /// edge-set. Given a bool-valued map on the node-set and one on - /// the edge-set of the graphs, the iterators shows only the objects + /// the edge-set of the graphs, the iterators show only the objects /// having true value. /// The quick brown fox iterators jump over /// the lazy dog nodes or edges if their values for are false in the @@ -577,15 +578,15 @@ }; - /// \brief An undirected graph template. - /// - ///\warning Graph wrappers are in even more experimental state than the other - ///parts of the lib. Use them at your own risk. - /// - /// An undirected graph template. - /// This class works as an undirected graph and a directed graph of - /// class \c Graph is used for the physical storage. - /// \ingroup graphs +// /// \brief An undirected graph template. +// /// +// ///\warning Graph wrappers are in even more experimental state than the other +// ///parts of the lib. Use them at your own risk. +// /// +// /// An undirected graph template. +// /// This class works as an undirected graph and a directed graph of +// /// class \c Graph is used for the physical storage. +// /// \ingroup graphs template class UndirGraph : public UndirGraphWrapper { typedef UndirGraphWrapper Parent; @@ -608,7 +609,8 @@ ///parts of the lib. Use them at you own risk. /// /// Suppose that for a directed graph $G=(V, A)$, - /// two predicates on the edge-set, $forward_filter$, and $backward_filter$ + /// two bool valued maps on the edge-set, + /// $forward_filter$, and $backward_filter$ /// is given, and we are dealing with the directed graph /// a $G'=(V, \{uv : uv\in A \mbox{ and } forward_filter(uv) \mbox{ is true}\}+\{vu : uv\in A \mbox{ and } backward_filter(uv) \mbox{ is true}\})$. /// The purpose of writing + instead of union is because parallel @@ -621,14 +623,14 @@ /// \c RevGraphWrapper is implemented in a different way. /// But BidirGraphWrapper is obtained from /// SubBidirGraphWrapper by considering everywhere true - /// predicates both forward_filter and backward_filter. + /// valued maps both for forward_filter and backward_filter. /// Finally, one of the most important applications of SubBidirGraphWrapper /// is ResGraphWrapper, which stands for the residual graph in directed /// flow and circulation problems. /// As wrappers usually, the SubBidirGraphWrapper implements the /// above mentioned graph structure without its physical storage, /// that is the whole stuff eats constant memory. - /// As the oppositely directed edges are logical different, + /// As the oppositely directed edges are logically different, /// the maps are able to attach different values for them. template @@ -670,7 +672,8 @@ typedef typename Graph::Edge GraphEdge; /// SubBidirGraphWrapper<..., ..., ...>::Edge is inherited from - /// Graph::Edge. It contains an extra bool flag which shows if the + /// Graph::Edge. It contains an extra bool flag which is true + /// if and only if the /// edge is the backward version of the original edge. class Edge : public Graph::Edge { friend class SubBidirGraphWrapper* res_graph; diff -r 6a22e0dfd453 -r 5a89cacf17f1 src/hugo/min_cost_flow.h --- a/src/hugo/min_cost_flow.h Sun Sep 26 21:43:38 2004 +0000 +++ b/src/hugo/min_cost_flow.h Mon Sep 27 18:11:27 2004 +0000 @@ -71,26 +71,26 @@ typedef typename Graph::template EdgeMap EdgeIntMap; - typedef ResGraphWrapper ResGraphType; - typedef typename ResGraphType::Edge ResGraphEdge; + typedef ResGraphWrapper ResGW; + typedef typename ResGW::Edge ResGraphEdge; class ModLengthMap { typedef typename Graph::template NodeMap NodeMap; - const ResGraphType& G; + const ResGW& G; const LengthMap &ol; const NodeMap &pot; public : typedef typename LengthMap::KeyType KeyType; typedef typename LengthMap::ValueType ValueType; - ValueType operator[](typename ResGraphType::Edge e) const { + ValueType operator[](typename ResGW::Edge e) const { if (G.forward(e)) return ol[e]-(pot[G.head(e)]-pot[G.tail(e)]); else return -ol[e]-(pot[G.head(e)]-pot[G.tail(e)]); } - ModLengthMap(const ResGraphType& _G, + ModLengthMap(const ResGW& _G, const LengthMap &o, const NodeMap &p) : G(_G), /*rev(_rev),*/ ol(o), pot(p){}; };//ModLengthMap @@ -152,12 +152,12 @@ //We need a residual graph - ResGraphType res_graph(G, capacity, flow); + ResGW res_graph(G, capacity, flow); ModLengthMap mod_length(res_graph, length, potential); - Dijkstra dijkstra(res_graph, mod_length); + Dijkstra dijkstra(res_graph, mod_length); int i; for (i=0; i + // /// \file // /// \brief Maximum flow algorithms. // /// \ingroup galgs @@ -38,7 +40,7 @@ /// types, e.g. with int. template - class TightEdgeFilterMap { + class TightEdgeFilterMap : public MapBase { protected: const Graph* g; NodePotentialMap* node_potential;