[Lemon-commits] [lemon_svn] alpar: r2043 - hugo/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:49:43 CET 2006


Author: alpar
Date: Tue Jul 12 18:16:19 2005
New Revision: 2043

Modified:
   hugo/trunk/lemon/graph_utils.h
   hugo/trunk/lemon/kruskal.h
   hugo/trunk/lemon/maps.h

Log:
Improve doc

Modified: hugo/trunk/lemon/graph_utils.h
==============================================================================
--- hugo/trunk/lemon/graph_utils.h	(original)
+++ hugo/trunk/lemon/graph_utils.h	Tue Jul 12 18:16:19 2005
@@ -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 Target, typename Source, 

Modified: hugo/trunk/lemon/kruskal.h
==============================================================================
--- hugo/trunk/lemon/kruskal.h	(original)
+++ hugo/trunk/lemon/kruskal.h	Tue Jul 12 18:16:19 2005
@@ -45,7 +45,7 @@
   /// Kruskal's algorithm to find a minimum cost tree of a graph.
 
   /// This function runs Kruskal's algorithm to find a minimum cost tree.
-  /// \param G The graph the algorithm runs on. The algorithm considers the
+  /// \param g The graph the algorithm runs on. The algorithm considers the
   /// graph to be undirected, the direction of the edges are not used.
   ///
   /// \param in This object is used to describe the edge costs. It must
@@ -76,21 +76,21 @@
 
   template <class GR, class IN, class OUT>
   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<int> NodeIntMap;
     typedef typename GR::Node Node;
 
-    NodeIntMap comp(G, -1);
+    NodeIntMap comp(g, -1);
     UnionFind<Node,NodeIntMap> 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:
-  /// <tt>kruskal(G, some_input, makeSequenceOutput(iterator))</tt>.
+  /// <tt>kruskal(g, some_input, makeSequenceOutput(iterator))</tt>.
   /// 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 <class GR, class IN, class OUT>
   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<OUT> map_wr(out_map);
-    return kruskal(G, edges, map_wr);
+    return kruskal(g, edges, map_wr);
   }  
 
   /* ** ** Input-objects ** ** */
@@ -175,17 +175,17 @@
 
     template<class _GR>
     typename enable_if<typename _GR::UndirTag,void>::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<class _GR>
     typename disable_if<typename _GR::UndirTag,void>::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<class GR, class Map>
   inline
-  KruskalMapInput<GR,Map> makeKruskalMapInput(const GR &G,const Map &m)
+  KruskalMapInput<GR,Map> makeKruskalMapInput(const GR &g,const Map &m)
   {
-    return KruskalMapInput<GR,Map>(G,m);
+    return KruskalMapInput<GR,Map>(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 <class GR, class IN, class RET>
   inline
   typename IN::Value
-  kruskalEdgeMap(GR const& G,
+  kruskalEdgeMap(GR const& g,
 		 IN const& in,
 		 RET &out) {
-    return kruskal(G,
-		   KruskalMapInput<GR,IN>(G,in),
+    return kruskal(g,
+		   KruskalMapInput<GR,IN>(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
   /// <tt>GR::Edge</tt> as its <tt>value_type</tt>.
   /// 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<Edge> 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<Edge> 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 <class GR, class IN, class RET>
   inline
   typename IN::Value
-  kruskalEdgeMap_IteratorOut(const GR& G,
+  kruskalEdgeMap_IteratorOut(const GR& g,
 			     const IN& in,
 			     RET out)
   {
     KruskalSequenceOutput<RET> _out(out);
-    return kruskal(G, KruskalMapInput<GR,IN>(G, in), _out);
+    return kruskal(g, KruskalMapInput<GR,IN>(g, in), _out);
   }
 
   /// @}

Modified: hugo/trunk/lemon/maps.h
==============================================================================
--- hugo/trunk/lemon/maps.h	(original)
+++ hugo/trunk/lemon/maps.h	Tue Jul 12 18:16:19 2005
@@ -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 M, class T> 
   class ConvertMap {
     typename SmartConstReference<M>::Type m;
@@ -304,7 +302,7 @@
     return AddMap<M1,M2>(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<X> sh(x,v);
   ///\endcode
-  ///it is equivalent with
+  ///is equivalent with
   ///\code
   ///  ConstMap<X::Key, X::Value> c_tmp(v);
   ///  AddMap<X, ConstMap<X::Key, X::Value> > 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>(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<X> sc(x,v);
   ///\endcode
-  ///it is equivalent with
+  ///is equivalent with
   ///\code
   ///  ConstMap<X::Key, X::Value> c_tmp(v);
   ///  MulMap<X, ConstMap<X::Key, X::Value> > 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>(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.



More information about the Lemon-commits mailing list