# HG changeset patch # User alpar # Date 1128594525 0 # Node ID 49d22d34d95f975d0c634e3c60819b502f44e0d7 # Parent 4fb435ad31cfc0c9ccc381536b4dbbc338077d61 Doc improvments diff -r 4fb435ad31cf -r 49d22d34d95f NEWS --- a/NEWS Thu Oct 06 09:58:21 2005 +0000 +++ b/NEWS Thu Oct 06 10:28:45 2005 +0000 @@ -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() diff -r 4fb435ad31cf -r 49d22d34d95f doc/getstart.dox --- a/doc/getstart.dox Thu Oct 06 09:58:21 2005 +0000 +++ b/doc/getstart.dox Thu Oct 06 10:28:45 2005 +0000 @@ -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 -lemon tells the compiler that we are using the installed library LEMON): diff -r 4fb435ad31cf -r 49d22d34d95f doc/named-param.dox --- a/doc/named-param.dox Thu Oct 06 09:58:21 2005 +0000 +++ b/doc/named-param.dox Thu Oct 06 10:28:45 2005 +0000 @@ -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 run() 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 .run() 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, .run() 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