Changeset 1713:49d22d34d95f in lemon-0.x for doc

Ignore:
Timestamp:
10/06/05 12:28:45 (14 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2240
Message:

Doc improvments

Location:
doc
Files:
2 edited

Unmodified
Removed
• doc/getstart.dox

 r1640 \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 \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 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. 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):
• doc/named-param.dox

 r1709 \code class named_fn class namedFn { int _id; 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() { 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 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
Note: See TracChangeset for help on using the changeset viewer.