# HG changeset patch # User alpar # Date 1121184979 0 # Node ID dd57a540ff5f87cb7ffd711ebfc7503c9f972d44 # Parent 3fcb8ae9cea1abc2afe759008614895a951e1bc0 Improve doc diff -r 3fcb8ae9cea1 -r dd57a540ff5f lemon/graph_utils.h --- a/lemon/graph_utils.h Tue Jul 12 16:15:37 2005 +0000 +++ b/lemon/graph_utils.h Tue Jul 12 16:16:19 2005 +0000 @@ -193,7 +193,7 @@ /// \brief Copy a map. /// - /// Thsi function copies the \c source map to the \c target map. It uses the + /// This function copies the \c source map to the \c target map. It uses the /// given iterator to iterate on the data structure and it uses the \c ref /// mapping to convert the source's keys to the target's keys. template typename IN::value_type::second_type - kruskal(GR const& G, IN const& in, + kruskal(GR const& g, IN const& in, OUT& out) { typedef typename IN::value_type::second_type EdgeCost; typedef typename GR::template NodeMap NodeIntMap; typedef typename GR::Node Node; - NodeIntMap comp(G, -1); + NodeIntMap comp(g, -1); UnionFind uf(comp); EdgeCost tot_cost = 0; for (typename IN::const_iterator p = in.begin(); p!=in.end(); ++p ) { - if ( uf.join(G.target((*p).first), - G.source((*p).first)) ) { + if ( uf.join(g.target((*p).first), + g.source((*p).first)) ) { out.set((*p).first, true); tot_cost += (*p).second; } @@ -109,7 +109,7 @@ /// on-the-fly. /// /// A typical examle is the following call: - /// kruskal(G, some_input, makeSequenceOutput(iterator)). + /// kruskal(g, some_input, makeSequenceOutput(iterator)). /// Here, the third argument is a temporary object (which wraps around an /// iterator with a writable bool map interface), and thus by rules of C++ /// is a \c const object. To enable call like this exist this class and @@ -130,10 +130,10 @@ template inline typename IN::value_type::second_type - kruskal(GR const& G, IN const& edges, OUT const& out_map) + kruskal(GR const& g, IN const& edges, OUT const& out_map) { NonConstMapWr map_wr(out_map); - return kruskal(G, edges, map_wr); + return kruskal(g, edges, map_wr); } /* ** ** Input-objects ** ** */ @@ -175,17 +175,17 @@ template typename enable_if::type - fillWithEdges(const _GR& G, const Map& m,dummy<0> = 0) + fillWithEdges(const _GR& g, const Map& m,dummy<0> = 0) { - for(typename GR::UndirEdgeIt e(G);e!=INVALID;++e) + for(typename GR::UndirEdgeIt e(g);e!=INVALID;++e) push_back(value_type(typename GR::Edge(e,true), m[e])); } template typename disable_if::type - fillWithEdges(const _GR& G, const Map& m,dummy<1> = 1) + fillWithEdges(const _GR& g, const Map& m,dummy<1> = 1) { - for(typename GR::EdgeIt e(G);e!=INVALID;++e) + for(typename GR::EdgeIt e(g);e!=INVALID;++e) push_back(value_type(e, m[e])); } @@ -196,8 +196,8 @@ std::sort(this->begin(), this->end(), comparePair()); } - KruskalMapInput(GR const& G, Map const& m) { - fillWithEdges(G,m); + KruskalMapInput(GR const& g, Map const& m) { + fillWithEdges(g,m); sort(); } }; @@ -211,7 +211,7 @@ /// In most cases you possibly /// want to use the function kruskalEdgeMap() instead. /// - ///\param G The type of the graph the algorithm runs on. + ///\param g The type of the graph the algorithm runs on. ///\param m An edge map containing the cost of the edges. ///\par ///The cost type can be any type satisfying the @@ -223,9 +223,9 @@ /// template inline - KruskalMapInput makeKruskalMapInput(const GR &G,const Map &m) + KruskalMapInput makeKruskalMapInput(const GR &g,const Map &m) { - return KruskalMapInput(G,m); + return KruskalMapInput(g,m); } @@ -291,7 +291,7 @@ /// Wrapper function to kruskal(). /// Input is from an edge map, output is a plain bool map. /// - ///\param G The type of the graph the algorithm runs on. + ///\param g The type of the graph the algorithm runs on. ///\param in An edge map containing the cost of the edges. ///\par ///The cost type can be any type satisfying the @@ -310,11 +310,11 @@ template inline typename IN::Value - kruskalEdgeMap(GR const& G, + kruskalEdgeMap(GR const& g, IN const& in, RET &out) { - return kruskal(G, - KruskalMapInput(G,in), + return kruskal(g, + KruskalMapInput(g,in), out); } @@ -324,7 +324,7 @@ /// Wrapper function to kruskal(). /// Input is from an edge map, output is an STL Sequence. /// - ///\param G The type of the graph the algorithm runs on. + ///\param g The type of the graph the algorithm runs on. ///\param in An edge map containing the cost of the edges. ///\par ///The cost type can be any type satisfying the @@ -335,17 +335,17 @@ /// \retval out This must be an iteraror of an STL Container with /// GR::Edge as its value_type. /// The algorithm copies the elements of the found tree into this sequence. - /// For example, if we know that the spanning tree of the graph \c G has + /// For example, if we know that the spanning tree of the graph \c g has /// say 53 edges then /// we can put its edges into a STL vector \c tree with a code like this. /// \code /// std::vector tree(53); - /// kruskalEdgeMap_IteratorOut(G,cost,tree.begin()); + /// kruskalEdgeMap_IteratorOut(g,cost,tree.begin()); /// \endcode /// Or if we don't know in advance the size of the tree, we can write this. /// \code /// std::vector tree; - /// kruskalEdgeMap_IteratorOut(G,cost,std::back_inserter(tree)); + /// kruskalEdgeMap_IteratorOut(g,cost,std::back_inserter(tree)); /// \endcode /// /// \return The cost of the found tree. @@ -355,12 +355,12 @@ template inline typename IN::Value - kruskalEdgeMap_IteratorOut(const GR& G, + kruskalEdgeMap_IteratorOut(const GR& g, const IN& in, RET out) { KruskalSequenceOutput _out(out); - return kruskal(G, KruskalMapInput(G, in), _out); + return kruskal(g, KruskalMapInput(g, in), _out); } /// @} diff -r 3fcb8ae9cea1 -r dd57a540ff5f lemon/maps.h --- a/lemon/maps.h Tue Jul 12 16:15:37 2005 +0000 +++ b/lemon/maps.h Tue Jul 12 16:16:19 2005 +0000 @@ -221,13 +221,11 @@ } }; - ///Convert the \c Value of a maps to another type. + ///Convert the \c Value of a map to another type. ///This \ref concept::ReadMap "read only map" ///converts the \c Value of a maps to type \c T. - ///Its \c Value is inherited from \c M. - /// - ///\bug wrong documentation + ///Its \c Key is inherited from \c M. template class ConvertMap { typename SmartConstReference::Type m; @@ -304,7 +302,7 @@ return AddMap(m1,m2); } - ///Shift a maps with a constant. + ///Shift a map with a constant. ///This \ref concept::ReadMap "read only map" returns the sum of the ///given map and a constant value. @@ -314,7 +312,7 @@ ///\code /// ShiftMap sh(x,v); ///\endcode - ///it is equivalent with + ///is equivalent with ///\code /// ConstMap c_tmp(v); /// AddMap > sh(x,v); @@ -355,7 +353,7 @@ ///Difference of two maps ///This \ref concept::ReadMap "read only map" returns the difference - ///of the values returned by the two + ///of the values of the two ///given maps. Its \c Key and \c Value will be inherited from \c M1. ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. @@ -391,7 +389,7 @@ ///Product of two maps ///This \ref concept::ReadMap "read only map" returns the product of the - ///values returned by the two + ///values of the two ///given ///maps. Its \c Key and \c Value will be inherited from \c M1. ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. @@ -424,17 +422,17 @@ return MulMap(m1,m2); } - ///Scale a maps with a constant. + ///Scales a maps with a constant. ///This \ref concept::ReadMap "read only map" returns the value of the - ///given map multipied with a constant value. + ///given map multiplied with a constant value. ///Its \c Key and \c Value is inherited from \c M. /// ///Actually, ///\code /// ScaleMap sc(x,v); ///\endcode - ///it is equivalent with + ///is equivalent with ///\code /// ConstMap c_tmp(v); /// MulMap > sc(x,v); @@ -475,7 +473,7 @@ ///Quotient of two maps ///This \ref concept::ReadMap "read only map" returns the quotient of the - ///values returned by the two + ///values of the two ///given maps. Its \c Key and \c Value will be inherited from \c M1. ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1. @@ -552,14 +550,14 @@ return ComposeMap(m1,m2); } - ///Combine of two maps using an STL (binary) functor. + ///Combines of two maps using an STL (binary) functor. - ///Combine of two maps using an STL (binary) functor. + ///Combines of two maps using an STL (binary) functor. /// /// - ///This \ref concept::ReadMap "read only map" takes to maps and a + ///This \ref concept::ReadMap "read only map" takes two maps and a ///binary functor and returns the composition of - ///two + ///the two ///given maps unsing the functor. ///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2 ///and \c f is of \c F, @@ -789,7 +787,7 @@ } - ///Apply all map setting operations to two maps + ///Applies all map setting operations to two maps ///This map has two \ref concept::WriteMap "writable map" ///parameters and each write request will be passed to both of them.