(UNDIR)GRAPH_TYPEDEFS also defines some basic graph maps
authoralpar
Wed, 16 Nov 2005 13:17:02 +0000
changeset 18047a76e35e4a78
parent 1803 ee8dd6872645
child 1805 d284f81f02a5
(UNDIR)GRAPH_TYPEDEFS also defines some basic graph maps
lemon/graph_utils.h
     1.1 --- a/lemon/graph_utils.h	Wed Nov 16 13:15:33 2005 +0000
     1.2 +++ b/lemon/graph_utils.h	Wed Nov 16 13:17:02 2005 +0000
     1.3 @@ -44,7 +44,8 @@
     1.4  
     1.5    ///This \c \#define creates convenience typedefs for the following types
     1.6    ///of \c Graph: \c Node,  \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
     1.7 -  ///\c OutEdgeIt.
     1.8 +  ///\c OutEdgeIt,  \c BoolNodeMap,  \c IntNodeMap,  \c DoubleNodeMap,
     1.9 +  ///\c BoolEdgeMap, \c IntEdgeMap,  \c DoubleEdgeMap.  
    1.10    ///\note If \c G it a template parameter, it should be used in this way.
    1.11    ///\code
    1.12    ///  GRAPH_TYPEDEFS(typename G)
    1.13 @@ -52,19 +53,26 @@
    1.14    ///
    1.15    ///\warning There are no typedefs for the graph maps because of the lack of
    1.16    ///template typedefs in C++.
    1.17 -#define GRAPH_TYPEDEFS(Graph)			\
    1.18 -  typedef Graph::     Node      Node;		\
    1.19 -    typedef Graph::   NodeIt    NodeIt;		\
    1.20 -    typedef Graph::   Edge      Edge;		\
    1.21 -    typedef Graph::   EdgeIt    EdgeIt;		\
    1.22 -    typedef Graph:: InEdgeIt  InEdgeIt;		\
    1.23 -    typedef Graph::OutEdgeIt OutEdgeIt;
    1.24 +#define GRAPH_TYPEDEFS(Graph)				\
    1.25 +  typedef Graph::     Node      Node;			\
    1.26 +    typedef Graph::   NodeIt    NodeIt;			\
    1.27 +    typedef Graph::   Edge      Edge;			\
    1.28 +    typedef Graph::   EdgeIt    EdgeIt;			\
    1.29 +    typedef Graph:: InEdgeIt  InEdgeIt;			\
    1.30 +    typedef Graph::OutEdgeIt OutEdgeIt;			\
    1.31 +    typedef Graph::Nodemap<bool> BoolNodeMap;		\
    1.32 +    typedef Graph::Nodemap<int> IntNodeMap;		\
    1.33 +    typedef Graph::Nodemap<double> DoubleNodeMap;	\
    1.34 +    typedef Graph::Edgemap<bool> BoolEdgeMap;		\
    1.35 +    typedef Graph::Edgemap<int> IntEdgeMap;		\
    1.36 +    typedef Graph::Edgemap<double> DoubleEdgeMap;
    1.37    
    1.38    ///Creates convenience typedefs for the undirected graph types and iterators
    1.39  
    1.40    ///This \c \#define creates the same convenience typedefs as defined by
    1.41    ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
    1.42    ///\c UndirEdge, \c UndirEdgeIt, \c IncEdgeIt,
    1.43 +  ///\c BoolUndirEdgeMap, \c IntUndirEdgeMap,  \c DoubleUndirEdgeMap.  
    1.44    ///
    1.45    ///\note If \c G it a template parameter, it should be used in this way.
    1.46    ///\code
    1.47 @@ -73,11 +81,15 @@
    1.48    ///
    1.49    ///\warning There are no typedefs for the graph maps because of the lack of
    1.50    ///template typedefs in C++.
    1.51 -#define UNDIRGRAPH_TYPEDEFS(Graph)			\
    1.52 -  GRAPH_TYPEDEFS(Graph)					\
    1.53 -    typedef Graph:: UndirEdge   UndirEdge;		\
    1.54 -    typedef Graph:: UndirEdgeIt UndirEdgeIt;		\
    1.55 -    typedef Graph:: IncEdgeIt   IncEdgeIt;
    1.56 +#define UNDIRGRAPH_TYPEDEFS(Graph)				\
    1.57 +  GRAPH_TYPEDEFS(Graph)						\
    1.58 +    typedef Graph:: UndirEdge   UndirEdge;			\
    1.59 +    typedef Graph:: UndirEdgeIt UndirEdgeIt;			\
    1.60 +    typedef Graph:: IncEdgeIt   IncEdgeIt;			\
    1.61 +    typedef Graph::UndirEdgemap<bool> BoolUndirEdgeMap;		\
    1.62 +    typedef Graph::UndirEdgemap<int> IntUndirEdgeMap;		\
    1.63 +    typedef Graph::UndirEdgemap<double> DoubleUndirEdgeMap;
    1.64 +  
    1.65  
    1.66  
    1.67    /// \brief Function to count the items in the graph.