lemon/graph_utils.h
changeset 1807 5f2f3d982eba
parent 1756 b1f441f24d08
child 1809 029cc4f638d1
equal deleted inserted replaced
28:5a2a34ae9176 29:e139b2307210
    42 
    42 
    43   ///Creates convenience typedefs for the graph types and iterators
    43   ///Creates convenience typedefs for the graph types and iterators
    44 
    44 
    45   ///This \c \#define creates convenience typedefs for the following types
    45   ///This \c \#define creates convenience typedefs for the following types
    46   ///of \c Graph: \c Node,  \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
    46   ///of \c Graph: \c Node,  \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
    47   ///\c OutEdgeIt.
    47   ///\c OutEdgeIt,  \c BoolNodeMap,  \c IntNodeMap,  \c DoubleNodeMap,
       
    48   ///\c BoolEdgeMap, \c IntEdgeMap,  \c DoubleEdgeMap.  
    48   ///\note If \c G it a template parameter, it should be used in this way.
    49   ///\note If \c G it a template parameter, it should be used in this way.
    49   ///\code
    50   ///\code
    50   ///  GRAPH_TYPEDEFS(typename G)
    51   ///  GRAPH_TYPEDEFS(typename G)
    51   ///\endcode
    52   ///\endcode
    52   ///
    53   ///
    53   ///\warning There are no typedefs for the graph maps because of the lack of
    54   ///\warning There are no typedefs for the graph maps because of the lack of
    54   ///template typedefs in C++.
    55   ///template typedefs in C++.
    55 #define GRAPH_TYPEDEFS(Graph)			\
    56 #define GRAPH_TYPEDEFS(Graph)				\
    56   typedef Graph::     Node      Node;		\
    57   typedef Graph::     Node      Node;			\
    57     typedef Graph::   NodeIt    NodeIt;		\
    58     typedef Graph::   NodeIt    NodeIt;			\
    58     typedef Graph::   Edge      Edge;		\
    59     typedef Graph::   Edge      Edge;			\
    59     typedef Graph::   EdgeIt    EdgeIt;		\
    60     typedef Graph::   EdgeIt    EdgeIt;			\
    60     typedef Graph:: InEdgeIt  InEdgeIt;		\
    61     typedef Graph:: InEdgeIt  InEdgeIt;			\
    61     typedef Graph::OutEdgeIt OutEdgeIt;
    62     typedef Graph::OutEdgeIt OutEdgeIt;			\
       
    63     typedef Graph::Nodemap<bool> BoolNodeMap;		\
       
    64     typedef Graph::Nodemap<int> IntNodeMap;		\
       
    65     typedef Graph::Nodemap<double> DoubleNodeMap;	\
       
    66     typedef Graph::Edgemap<bool> BoolEdgeMap;		\
       
    67     typedef Graph::Edgemap<int> IntEdgeMap;		\
       
    68     typedef Graph::Edgemap<double> DoubleEdgeMap;
    62   
    69   
    63   ///Creates convenience typedefs for the undirected graph types and iterators
    70   ///Creates convenience typedefs for the undirected graph types and iterators
    64 
    71 
    65   ///This \c \#define creates the same convenience typedefs as defined by
    72   ///This \c \#define creates the same convenience typedefs as defined by
    66   ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
    73   ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
    67   ///\c UndirEdge, \c UndirEdgeIt, \c IncEdgeIt,
    74   ///\c UndirEdge, \c UndirEdgeIt, \c IncEdgeIt,
       
    75   ///\c BoolUndirEdgeMap, \c IntUndirEdgeMap,  \c DoubleUndirEdgeMap.  
    68   ///
    76   ///
    69   ///\note If \c G it a template parameter, it should be used in this way.
    77   ///\note If \c G it a template parameter, it should be used in this way.
    70   ///\code
    78   ///\code
    71   ///  UNDIRGRAPH_TYPEDEFS(typename G)
    79   ///  UNDIRGRAPH_TYPEDEFS(typename G)
    72   ///\endcode
    80   ///\endcode
    73   ///
    81   ///
    74   ///\warning There are no typedefs for the graph maps because of the lack of
    82   ///\warning There are no typedefs for the graph maps because of the lack of
    75   ///template typedefs in C++.
    83   ///template typedefs in C++.
    76 #define UNDIRGRAPH_TYPEDEFS(Graph)			\
    84 #define UNDIRGRAPH_TYPEDEFS(Graph)				\
    77   GRAPH_TYPEDEFS(Graph)					\
    85   GRAPH_TYPEDEFS(Graph)						\
    78     typedef Graph:: UndirEdge   UndirEdge;		\
    86     typedef Graph:: UndirEdge   UndirEdge;			\
    79     typedef Graph:: UndirEdgeIt UndirEdgeIt;		\
    87     typedef Graph:: UndirEdgeIt UndirEdgeIt;			\
    80     typedef Graph:: IncEdgeIt   IncEdgeIt;
    88     typedef Graph:: IncEdgeIt   IncEdgeIt;			\
       
    89     typedef Graph::UndirEdgemap<bool> BoolUndirEdgeMap;		\
       
    90     typedef Graph::UndirEdgemap<int> IntUndirEdgeMap;		\
       
    91     typedef Graph::UndirEdgemap<double> DoubleUndirEdgeMap;
       
    92   
    81 
    93 
    82 
    94 
    83   /// \brief Function to count the items in the graph.
    95   /// \brief Function to count the items in the graph.
    84   ///
    96   ///
    85   /// This function counts the items (nodes, edges etc) in the graph.
    97   /// This function counts the items (nodes, edges etc) in the graph.