# Changeset 1536:308150155bb5 in lemon-0.x

Ignore:
Timestamp:
07/04/05 18:27:54 (14 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2028
Message:

Kill several doxygen warnings

Files:
11 edited

Unmodified
Removed
• ## doc/groups.dox

 r1402 Map adaptors are used to create "implicit" maps from other maps. Most of them are \ref concept::ReadMap "ReadMap"s. They can Most of them are \ref lemon::concept::ReadMap "ReadMap"s. They can make arithmetic oprerations between one or two maps (negation, scalig, addition, multiplication etc.) or e.g. convert a map to another one

• ## doc/named-param.dox

 r1438 \section named-func-param Named "Function" Parameters C++ makes it possible to use default parameter values when calling a function. In such a case we do not have to give value for parameters, the program will use the default ones. Unfortunately sometimes this is not enough. If we do not want to give values for all the parameters, only for some of them we come across problems, because an arbitrary set of parameters cannot be omitted. On the other hand parameters have a fixed order in the head of the function. C++ can apply the default values only in the back of the order, if we do not give other value for them. So we can not give the function for example the value of the first, and the third parameter, expecting that the program will aplly the default value for the second parameter. However sometimes we would like to use some functinos exactly in this way. With a crafty trick and with some little inconvenience this is possible. We have implemented this little trick as an example below. C++ makes it possible to use default parameter values when calling a function. In such a case we do not have to give value for parameters, the program will use the default ones.  Unfortunately sometimes this is not enough. If we do not want to give values for all the parameters, only for some of them we come across problems, because an arbitrary set of parameters cannot be omitted. On the other hand parameters have a fixed order in the head of the function.  C++ can apply the default values only in the back of the order, if we do not give other value for them.  So we can not give the function for example the value of the first, and the third parameter, expecting that the program will aplly the default value for the second parameter.  However sometimes we would like to use some functinos exactly in this way. With a crafty trick and with some little inconvenience this is possible. We have implemented this little trick as an example below. \code The usage is the following. We have to define a class, let's call it named_fn. Let us assume that we would like to use a parameter, called X. In the named_fn class we have to define an _X attribute, and an X function. The function expects a parameter with the type of _X, and sets the value of _X. After setting the value the function returns the class itself. The class also have to have a function, called for example run(), we have to implement here the original function itself. The constructor of the class have to give all the attributes like _X the default values of them. We have to define a class, let's call it named_fn.  Let us assume that we would like to use a parameter, called X. In the named_fn class we have to define an _X attribute, and an X function. The function expects a parameter with the type of _X, and sets the value of _X. After setting the value the function returns the class itself. The class also have to have a function, called for example run(), we have to implement here the original function itself. The constructor of the class have to give all the attributes like _X the default values of them. If we instantiate this class, the default values will be set for the attributes (originally the parameters), initially. If we call the X function, we get a class with the modified parameter value of X. Therefore we can modify any parameter-value, independent from the order. To run the algorithm we have to call the run() function at the end of the row. If we instantiate this class, the default values will be set for the attributes (originally the parameters), initially. If we call the X function, we get a class with the modified parameter value of X. Therefore we can modify any parameter-value, independent from the order. To run the algorithm we have to call the run() function at the end of the row. Example: named_fn().id(3).val(2).run(); \section traits-classes Traits Classes The procedure above can also be applied when defining classes. In this case the type of the attributes can be changed. Initially we have to define a class with the default attribute types. This is the so called Traits Class. Later on the types of these attributes can be changed, as described below. In our software \ref DijkstraDefaultTraits is an example of how a traits class looks like. The procedure above can also be applied when defining classes. In this case the type of the attributes can be changed.  Initially we have to define a class with the default attribute types. This is the so called Traits Class. Later on the types of these attributes can be changed, as described below. In our software \ref lemon::DijkstraDefaultTraits is an example of how a traits class looks like. \section named-templ-param Named Class Template Parameters If we would like to change the type of an attribute in a class that was instantiated by using a traits class as a template parameter, and the class contains named parameters, we do not have to reinstantiate the class with new traits class. Instead of that, adaptor classes can be used like in the following cases. If we would like to change the type of an attribute in a class that was instantiated by using a traits class as a template parameter, and the class contains named parameters, we do not have to reinstantiate the class with new traits class. Instead of that, adaptor classes can be used like in the following cases. \code \endcode The result will be an instantiated Dijkstra class, in which the DistMap and the PredMap is modified. The result will be an instantiated Dijkstra class, in which the DistMap and the PredMap is modified. \section named-templ-func-param Named "Function" Template Parameters If the class has so called wizard functions, the new class with the modified tpye of attributes can be returned by the appropriate wizard function. The usage of these wizard functions is the following: If the class has so called wizard functions, the new class with the modified tpye of attributes can be returned by the appropriate wizard function. The usage of these wizard functions is the following: */
• ## lemon/bfs.h

 r1516 ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function copies the shortest path to \c t into \c p. ///If it \c \t is a source itself or unreachable, then it does not ///If \c t is a source itself or unreachable, then it does not ///alter \c p. ///\todo Is it the right way to handle unreachable nodes? ///This function instantiates a \ref PredMap. ///\param G is the graph, to which we would like to define the PredMap. ///\param g is the graph, to which we would like to define the PredMap. ///\todo The graph alone may be insufficient to initialize #ifdef DOXYGEN static PredMap *createPredMap(const GR &g) #else static PredMap *createPredMap(const GR &) #endif { return new PredMap(); ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function instantiates a \ref DistMap. ///\param G is the graph, to which we would like to define the \ref DistMap ///\param g is the graph, to which we would like to define the \ref DistMap #ifdef DOXYGEN static DistMap *createDistMap(const GR &g) #else static DistMap *createDistMap(const GR &) #endif { return new DistMap();
• ## lemon/dfs.h

 r1529 ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function instantiates a \ref PredMap. ///\param G is the graph, to which we would like to define the PredMap. ///\param g is the graph, to which we would like to define the PredMap. ///\todo The graph alone may be insufficient to initialize #ifdef DOXYGEN static PredMap *createPredMap(const GR &g) #else static PredMap *createPredMap(const GR &) #endif { return new PredMap(); ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function instantiates a \ref DistMap. ///\param G is the graph, to which we would like to define the \ref DistMap ///\param g is the graph, to which we would like to define the \ref DistMap #ifdef DOXYGEN static DistMap *createDistMap(const GR &g) #else static DistMap *createDistMap(const GR &) #endif { return new DistMap();
• ## lemon/dijkstra.h

 r1516 ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function copies the shortest path to \c t into \c p. ///If it \c \t is a source itself or unreachable, then it does not ///If it \c t is a source itself or unreachable, then it does not ///alter \c p. ///\todo Is it the right way to handle unreachable nodes? ///This function instantiates a \ref PredMap. ///\param G is the graph, to which we would like to define the PredMap. ///\param g is the graph, to which we would like to define the PredMap. ///\todo The graph alone may be insufficient for the initialization #ifdef DOXYGEN static PredMap *createPredMap(const GR &g) #else static PredMap *createPredMap(const GR &) #endif { return new PredMap(); ///This function instantiates a \ref ProcessedMap. ///\param G is the graph, to which ///\param g is the graph, to which ///we would like to define the \ref ProcessedMap #ifdef DOXYGEN static ProcessedMap *createProcessedMap(const GR &g) #else static ProcessedMap *createProcessedMap(const GR &) #endif { return new ProcessedMap(); ///This function instantiates a \ref DistMap. ///\param G is the graph, to which we would like to define the \ref DistMap ///\param g is the graph, to which we would like to define the \ref DistMap #ifdef DOXYGEN static DistMap *createDistMap(const GR &g) #else static DistMap *createDistMap(const GR &) #endif { return new DistMap();
• ## lemon/error.h

 r1435 protected: ///\e ///\todo The good solution is boost:shared_ptr... ///\todo The good solution is boost::shared_ptr... /// mutable std::auto_ptr buf;