# HG changeset patch # User marci # Date 1084294952 0 # Node ID 0856a9a87eb92f0c4bf624a0a4e710258ad6c21e # Parent 83530dad618a2da222436d3756d3118791d997cb BidirGraph, UndirGraph some docs, in group graphs diff -r 83530dad618a -r 0856a9a87eb9 src/hugo/graph_wrapper.h --- a/src/hugo/graph_wrapper.h Tue May 11 16:38:17 2004 +0000 +++ b/src/hugo/graph_wrapper.h Tue May 11 17:02:32 2004 +0000 @@ -82,8 +82,7 @@ ///This is the base type for the Graph Wrappers. ///\todo Some more docs... /// - ///\author Marton Makai - + ///\author Marton Makai template class GraphWrapper { protected: @@ -223,12 +222,13 @@ /// A graph wrapper which reverses the orientation of the edges. /// A graph wrapper which reverses the orientation of the edges. + /// Thus \c Graph have to be a directed graph type. /// ///\author Marton Makai template class RevGraphWrapper : public GraphWrapper { protected: - RevGraphWrapper() : GraphWrapper(0) { } + RevGraphWrapper() : GraphWrapper() { } public: RevGraphWrapper(Graph& _graph) : GraphWrapper(_graph) { } @@ -296,7 +296,7 @@ - /// Wrapper for hiding nodes and edges from a graph. + /// A graph wrapper for hiding nodes and edges from a graph. /// This wrapper shows a graph with filtered node-set and /// edge-set. The quick brown fox iterator jumps over @@ -311,7 +311,7 @@ NodeFilterMap* node_filter_map; EdgeFilterMap* edge_filter_map; - SubGraphWrapper() : GraphWrapper(0), + SubGraphWrapper() : GraphWrapper(), node_filter_map(0), edge_filter_map(0) { } void setNodeFilterMap(NodeFilterMap& _node_filter_map) { node_filter_map=&_node_filter_map; @@ -488,12 +488,12 @@ - /// A wrapper for forgetting the orientation of a graph. - + /// \brief A wrapper for forgetting the orientation of a graph. + /// /// A wrapper for getting an undirected graph by forgetting /// the orientation of a directed one. /// - ///\author Marton Makai + /// \author Marton Makai template class UndirGraphWrapper : public GraphWrapper { protected: @@ -573,9 +573,12 @@ return this->graph->tail(e); } }; - - - /// An undirected graph template + /// \brief An undirected graph template. + /// + /// 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; @@ -588,11 +591,14 @@ }; + ///\brief A wrapper for composing bidirected graph from a directed one. + /// experimental, for fezso's sake. + /// /// A wrapper for composing bidirected graph from a directed one. /// experimental, for fezso's sake. - - /// A wrapper for composing bidirected graph from a directed one. - /// experimental, for fezso's sake. + /// A bidirected graph is composed over the directed one without physical + /// storage. As the oppositely directed edges are logically different ones + /// the maps are able to attach different values for them. template class BidirGraphWrapper : public GraphWrapper { protected: @@ -910,6 +916,25 @@ }; }; + /// \brief A bidirected graph template. + /// + /// A bidirected graph template. + /// Such a bidirected graph stores each pair of oppositely directed edges + /// ones in the memory, i.e. a directed graph of type + /// \c Graph is used for that. + /// As the oppositely directed edges are logically different ones + /// the maps are able to attach different values for them. + /// \ingroup graphs + template + class BidirGraph : public BidirGraphWrapper { + typedef UndirGraphWrapper Parent; + protected: + Graph gr; + public: + BidirGraph() : BidirGraphWrapper() { + Parent::setGraph(gr); + } + }; /// A wrapper for composing the residual graph for directed flow and circulation problems. @@ -1226,9 +1251,14 @@ - /// ErasingFirstGraphWrapper for blocking flows. + /// For blocking flows. - /// ErasingFirstGraphWrapper for blocking flows. + /// This graph wrapper is used for Dinits blocking flow computations. + /// For each node, an out-edge is stored which is used when the + /// \code + /// OutEdgeIt& first(OutEdgeIt&, const Node&) + /// \endcode + /// is called. /// ///\author Marton Makai template