Doc improvments
authoralpar
Thu, 06 Oct 2005 10:28:45 +0000
changeset 171349d22d34d95f
parent 1712 4fb435ad31cf
child 1714 66c89fe52d4e
Doc improvments
NEWS
doc/getstart.dox
doc/named-param.dox
     1.1 --- a/NEWS	Thu Oct 06 09:58:21 2005 +0000
     1.2 +++ b/NEWS	Thu Oct 06 10:28:45 2005 +0000
     1.3 @@ -1,11 +1,13 @@
     1.4  2005-??-??  Version 0.5 Released
     1.5 +	* Changed namings:
     1.6 +	  - Access functions of TimeStamp/Timer
     1.7  	* Buxfix in
     1.8  	  - DFS
     1.9  	  - Preflow
    1.10 -
    1.11 +	  
    1.12  2005-08-27  Version 0.4 Released
    1.13  	* List of new features and changes	
    1.14 -	  * Changed naming:
    1.15 +	  * Changed namings:
    1.16  	    Wrapper -> Adaptor
    1.17  	    kruskalEdgeMap() -> kruskal()
    1.18  	    kruskalEdgeMap_IteratorOut() -> kruskal()
     2.1 --- a/doc/getstart.dox	Thu Oct 06 09:58:21 2005 +0000
     2.2 +++ b/doc/getstart.dox	Thu Oct 06 10:28:45 2005 +0000
     2.3 @@ -148,15 +148,15 @@
     2.4  --with-glpk-includedir=DIR
     2.5  \endverbatim
     2.6  The directory where the GLPK header files are located. This is only useful when
     2.7 -the GLPK headers and libraries are not under the same prefix (which is not
     2.8 -likely).
     2.9 +the GLPK headers and libraries are not under the same prefix (which is
    2.10 +unlikely).
    2.11  
    2.12  \verbatim
    2.13  --with-glpk-libdir=DIR
    2.14  \endverbatim
    2.15  The directory where the GLPK libraries are located. This is only useful when
    2.16 -the GLPK headers and libraries are not under the same prefix (which is not
    2.17 -likely).
    2.18 +the GLPK headers and libraries are not under the same prefix (which is
    2.19 +unlikely).
    2.20  
    2.21  \verbatim
    2.22  --without-glpk
    2.23 @@ -236,7 +236,7 @@
    2.24  ListGraph is one of LEMON's graph classes. It is based on linked lists,
    2.25  therefore iterating throuh its edges and nodes is fast.
    2.26  
    2.27 -After some convenient typedefs we create a graph and add three nodes to it.
    2.28 +After some convenience typedefs we create a graph and add three nodes to it.
    2.29  Then we add edges to it to form a complete graph.
    2.30  
    2.31  Then we iterate through all nodes of the graph. We use a constructor of the
    2.32 @@ -250,7 +250,7 @@
    2.33  \c source member functions can be used to access the endpoints of an edge.
    2.34  
    2.35  If your installation of LEMON into directory \c /usr/local was
    2.36 -successful then it is very easy to compile this program with the
    2.37 +successful, then it is very easy to compile this program with the
    2.38  following command (the argument <tt>-lemon</tt> tells the compiler
    2.39  that we are using the installed library LEMON):
    2.40  
     3.1 --- a/doc/named-param.dox	Thu Oct 06 09:58:21 2005 +0000
     3.2 +++ b/doc/named-param.dox	Thu Oct 06 10:28:45 2005 +0000
     3.3 @@ -21,17 +21,17 @@
     3.4  as an example below.
     3.5  
     3.6  \code
     3.7 -class named_fn 
     3.8 +class namedFn 
     3.9  {
    3.10    int _id;
    3.11    double _val;
    3.12    int _dim;
    3.13    
    3.14    public:
    3.15 -  named_fn() : _id(0), _val(1), _dim(2) {}
    3.16 -  named_fn& id(int p)     { _id  = p ; return *this; }
    3.17 -  named_fn& val(double p) { _val = p ; return *this; }
    3.18 -  named_fn& dim(int p)    { _dim = p ; return *this; }
    3.19 +  namedFn() : _id(0), _val(1), _dim(2) {}
    3.20 +  namedFn& id(int p)     { _id  = p ; return *this; }
    3.21 +  namedFn& val(double p) { _val = p ; return *this; }
    3.22 +  namedFn& dim(int p)    { _dim = p ; return *this; }
    3.23  
    3.24    run() {
    3.25      printf("Here is the function itself.");
    3.26 @@ -42,8 +42,8 @@
    3.27  
    3.28  The usage is the following.
    3.29  
    3.30 -We have to define a class, let's call it \c named_fn.  Let us assume that
    3.31 -we would like to use a parameter, called \c X. In the \c named_fn class we
    3.32 +We have to define a class, let's call it \c namedFn.  Let us assume that
    3.33 +we would like to use a parameter, called \c X. In the \c namedFn class we
    3.34  have to define an \c _X attribute, and a function \c X. The function
    3.35  expects a parameter with the type of \c _X, and sets the value of
    3.36  \c _X. After setting the value the function returns the class itself. The
    3.37 @@ -55,15 +55,26 @@
    3.38  If we instantiate this class, the default values will be set for the
    3.39  attributes (originally the parameters), initially. If we call function
    3.40  \c X, we get a class with the modified parameter value of
    3.41 -\c X. Therefore we can modify any parameter-value, independent from the
    3.42 +\c X. Therefore we can modify any parameter-value, independently from the
    3.43  order. To run the algorithm we have to call the <tt>run()</tt> function at the
    3.44  end of the row.
    3.45  
    3.46  Example:
    3.47  \code
    3.48 -named_fn().id(3).val(2).run();
    3.49 +namedFn().id(3).val(2).run();
    3.50  \endcode
    3.51  
    3.52 +\note Although it is a class, namedFn is used pretty much like as it were
    3.53 +a function. That it why it is called namedFn and not \c NamedFn.
    3.54 +
    3.55 +\note In fact, the final <tt>.run()</tt> could be made unnecessary if the
    3.56 +actual function code were put in the destructor instead. This however would make
    3.57 +hard to implement functions with return values, and would also make the
    3.58 +implementation of \ref named-templ-func-param "named template parameters"
    3.59 +very problematic. Therefore, by convention, <tt>.run()</tt> is used
    3.60 +to explicitly execute function having named parameters in Lemon. 
    3.61 +
    3.62 +
    3.63  \section traits-classes Traits Classes
    3.64  
    3.65  The procedure above can also be applied when defining classes. In this