[Lemon-commits] [lemon_svn] alpar: r2240 - in hugo/trunk: . doc

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


Author: alpar
Date: Thu Oct  6 12:28:45 2005
New Revision: 2240

Modified:
   hugo/trunk/NEWS
   hugo/trunk/doc/getstart.dox
   hugo/trunk/doc/named-param.dox

Log:
Doc improvments

Modified: hugo/trunk/NEWS
==============================================================================
--- hugo/trunk/NEWS	(original)
+++ hugo/trunk/NEWS	Thu Oct  6 12:28:45 2005
@@ -1,11 +1,13 @@
 2005-??-??  Version 0.5 Released
+	* Changed namings:
+	  - Access functions of TimeStamp/Timer
 	* Buxfix in
 	  - DFS
 	  - Preflow
-
+	  
 2005-08-27  Version 0.4 Released
 	* List of new features and changes	
-	  * Changed naming:
+	  * Changed namings:
 	    Wrapper -> Adaptor
 	    kruskalEdgeMap() -> kruskal()
 	    kruskalEdgeMap_IteratorOut() -> kruskal()

Modified: hugo/trunk/doc/getstart.dox
==============================================================================
--- hugo/trunk/doc/getstart.dox	(original)
+++ hugo/trunk/doc/getstart.dox	Thu Oct  6 12:28:45 2005
@@ -148,15 +148,15 @@
 --with-glpk-includedir=DIR
 \endverbatim
 The directory where the GLPK header files are located. This is only useful when
-the GLPK headers and libraries are not under the same prefix (which is not
-likely).
+the GLPK headers and libraries are not under the same prefix (which is
+unlikely).
 
 \verbatim
 --with-glpk-libdir=DIR
 \endverbatim
 The directory where the GLPK libraries are located. This is only useful when
-the GLPK headers and libraries are not under the same prefix (which is not
-likely).
+the GLPK headers and libraries are not under the same prefix (which is
+unlikely).
 
 \verbatim
 --without-glpk
@@ -236,7 +236,7 @@
 ListGraph is one of LEMON's graph classes. It is based on linked lists,
 therefore iterating throuh its edges and nodes is fast.
 
-After some convenient typedefs we create a graph and add three nodes to it.
+After some convenience typedefs we create a graph and add three nodes to it.
 Then we add edges to it to form a complete graph.
 
 Then we iterate through all nodes of the graph. We use a constructor of the
@@ -250,7 +250,7 @@
 \c source member functions can be used to access the endpoints of an edge.
 
 If your installation of LEMON into directory \c /usr/local was
-successful then it is very easy to compile this program with the
+successful, then it is very easy to compile this program with the
 following command (the argument <tt>-lemon</tt> tells the compiler
 that we are using the installed library LEMON):
 

Modified: hugo/trunk/doc/named-param.dox
==============================================================================
--- hugo/trunk/doc/named-param.dox	(original)
+++ hugo/trunk/doc/named-param.dox	Thu Oct  6 12:28:45 2005
@@ -21,17 +21,17 @@
 as an example below.
 
 \code
-class named_fn 
+class namedFn 
 {
   int _id;
   double _val;
   int _dim;
   
   public:
-  named_fn() : _id(0), _val(1), _dim(2) {}
-  named_fn& id(int p)     { _id  = p ; return *this; }
-  named_fn& val(double p) { _val = p ; return *this; }
-  named_fn& dim(int p)    { _dim = p ; return *this; }
+  namedFn() : _id(0), _val(1), _dim(2) {}
+  namedFn& id(int p)     { _id  = p ; return *this; }
+  namedFn& val(double p) { _val = p ; return *this; }
+  namedFn& dim(int p)    { _dim = p ; return *this; }
 
   run() {
     printf("Here is the function itself.");
@@ -42,8 +42,8 @@
 
 The usage is the following.
 
-We have to define a class, let's call it \c named_fn.  Let us assume that
-we would like to use a parameter, called \c X. In the \c named_fn class we
+We have to define a class, let's call it \c namedFn.  Let us assume that
+we would like to use a parameter, called \c X. In the \c namedFn class we
 have to define an \c _X attribute, and a function \c X. The function
 expects a parameter with the type of \c _X, and sets the value of
 \c _X. After setting the value the function returns the class itself. The
@@ -55,15 +55,26 @@
 If we instantiate this class, the default values will be set for the
 attributes (originally the parameters), initially. If we call function
 \c X, we get a class with the modified parameter value of
-\c X. Therefore we can modify any parameter-value, independent from the
+\c X. Therefore we can modify any parameter-value, independently from the
 order. To run the algorithm we have to call the <tt>run()</tt> function at the
 end of the row.
 
 Example:
 \code
-named_fn().id(3).val(2).run();
+namedFn().id(3).val(2).run();
 \endcode
 
+\note Although it is a class, namedFn is used pretty much like as it were
+a function. That it why it is called namedFn and not \c NamedFn.
+
+\note In fact, the final <tt>.run()</tt> could be made unnecessary if the
+actual function code were put in the destructor instead. This however would make
+hard to implement functions with return values, and would also make the
+implementation of \ref named-templ-func-param "named template parameters"
+very problematic. Therefore, by convention, <tt>.run()</tt> is used
+to explicitly execute function having named parameters in Lemon. 
+
+
 \section traits-classes Traits Classes
 
 The procedure above can also be applied when defining classes. In this



More information about the Lemon-commits mailing list