lemon/graph_utils.h
changeset 225 c5a40fc54f1a
parent 209 765619b7cbb2
equal deleted inserted replaced
8:127c20bbac0f 9:dbf70d3c47ac
    50   ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap.
    50   ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap.
    51   ///
    51   ///
    52   ///\note If the graph type is a dependent type, ie. the graph type depend
    52   ///\note If the graph type is a dependent type, ie. the graph type depend
    53   ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
    53   ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
    54   ///macro.
    54   ///macro.
    55 #define DIGRAPH_TYPEDEFS(Digraph)                                        \
    55 #define DIGRAPH_TYPEDEFS(Digraph)                                       \
    56   typedef Digraph::Node Node;                                                \
    56   typedef Digraph::Node Node;                                           \
    57   typedef Digraph::NodeIt NodeIt;                                        \
    57   typedef Digraph::NodeIt NodeIt;                                       \
    58   typedef Digraph::Arc Arc;                                                \
    58   typedef Digraph::Arc Arc;                                             \
    59   typedef Digraph::ArcIt ArcIt;                                                \
    59   typedef Digraph::ArcIt ArcIt;                                         \
    60   typedef Digraph::InArcIt InArcIt;                                        \
    60   typedef Digraph::InArcIt InArcIt;                                     \
    61   typedef Digraph::OutArcIt OutArcIt;                                        \
    61   typedef Digraph::OutArcIt OutArcIt;                                   \
    62   typedef Digraph::NodeMap<bool> BoolNodeMap;                                \
    62   typedef Digraph::NodeMap<bool> BoolNodeMap;                           \
    63   typedef Digraph::NodeMap<int> IntNodeMap;                                \
    63   typedef Digraph::NodeMap<int> IntNodeMap;                             \
    64   typedef Digraph::NodeMap<double> DoubleNodeMap;                        \
    64   typedef Digraph::NodeMap<double> DoubleNodeMap;                       \
    65   typedef Digraph::ArcMap<bool> BoolArcMap;                                \
    65   typedef Digraph::ArcMap<bool> BoolArcMap;                             \
    66   typedef Digraph::ArcMap<int> IntArcMap;                                \
    66   typedef Digraph::ArcMap<int> IntArcMap;                               \
    67   typedef Digraph::ArcMap<double> DoubleArcMap
    67   typedef Digraph::ArcMap<double> DoubleArcMap
    68 
    68 
    69   ///Creates convenience typedefs for the digraph types and iterators
    69   ///Creates convenience typedefs for the digraph types and iterators
    70 
    70 
    71   ///\see DIGRAPH_TYPEDEFS
    71   ///\see DIGRAPH_TYPEDEFS
    72   ///
    72   ///
    73   ///\note Use this macro, if the graph type is a dependent type,
    73   ///\note Use this macro, if the graph type is a dependent type,
    74   ///ie. the graph type depend on a template parameter.
    74   ///ie. the graph type depend on a template parameter.
    75 #define TEMPLATE_DIGRAPH_TYPEDEFS(Digraph)                                \
    75 #define TEMPLATE_DIGRAPH_TYPEDEFS(Digraph)                              \
    76   typedef typename Digraph::Node Node;                                        \
    76   typedef typename Digraph::Node Node;                                  \
    77   typedef typename Digraph::NodeIt NodeIt;                                \
    77   typedef typename Digraph::NodeIt NodeIt;                              \
    78   typedef typename Digraph::Arc Arc;                                        \
    78   typedef typename Digraph::Arc Arc;                                    \
    79   typedef typename Digraph::ArcIt ArcIt;                                \
    79   typedef typename Digraph::ArcIt ArcIt;                                \
    80   typedef typename Digraph::InArcIt InArcIt;                                \
    80   typedef typename Digraph::InArcIt InArcIt;                            \
    81   typedef typename Digraph::OutArcIt OutArcIt;                                \
    81   typedef typename Digraph::OutArcIt OutArcIt;                          \
    82   typedef typename Digraph::template NodeMap<bool> BoolNodeMap;                \
    82   typedef typename Digraph::template NodeMap<bool> BoolNodeMap;         \
    83   typedef typename Digraph::template NodeMap<int> IntNodeMap;                \
    83   typedef typename Digraph::template NodeMap<int> IntNodeMap;           \
    84   typedef typename Digraph::template NodeMap<double> DoubleNodeMap;        \
    84   typedef typename Digraph::template NodeMap<double> DoubleNodeMap;     \
    85   typedef typename Digraph::template ArcMap<bool> BoolArcMap;                \
    85   typedef typename Digraph::template ArcMap<bool> BoolArcMap;           \
    86   typedef typename Digraph::template ArcMap<int> IntArcMap;                \
    86   typedef typename Digraph::template ArcMap<int> IntArcMap;             \
    87   typedef typename Digraph::template ArcMap<double> DoubleArcMap
    87   typedef typename Digraph::template ArcMap<double> DoubleArcMap
    88 
    88 
    89   ///Creates convenience typedefs for the graph types and iterators
    89   ///Creates convenience typedefs for the graph types and iterators
    90 
    90 
    91   ///This \c \#define creates the same convenience typedefs as defined
    91   ///This \c \#define creates the same convenience typedefs as defined
    94   ///\c DoubleEdgeMap.
    94   ///\c DoubleEdgeMap.
    95   ///
    95   ///
    96   ///\note If the graph type is a dependent type, ie. the graph type depend
    96   ///\note If the graph type is a dependent type, ie. the graph type depend
    97   ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
    97   ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
    98   ///macro.
    98   ///macro.
    99 #define GRAPH_TYPEDEFS(Graph)                                                \
    99 #define GRAPH_TYPEDEFS(Graph)                                           \
   100   DIGRAPH_TYPEDEFS(Graph);                                                \
   100   DIGRAPH_TYPEDEFS(Graph);                                              \
   101   typedef Graph::Edge Edge;                                                \
   101   typedef Graph::Edge Edge;                                             \
   102   typedef Graph::EdgeIt EdgeIt;                                                \
   102   typedef Graph::EdgeIt EdgeIt;                                         \
   103   typedef Graph::IncEdgeIt IncEdgeIt;                                        \
   103   typedef Graph::IncEdgeIt IncEdgeIt;                                   \
   104   typedef Graph::EdgeMap<bool> BoolEdgeMap;                                \
   104   typedef Graph::EdgeMap<bool> BoolEdgeMap;                             \
   105   typedef Graph::EdgeMap<int> IntEdgeMap;                                \
   105   typedef Graph::EdgeMap<int> IntEdgeMap;                               \
   106   typedef Graph::EdgeMap<double> DoubleEdgeMap
   106   typedef Graph::EdgeMap<double> DoubleEdgeMap
   107 
   107 
   108   ///Creates convenience typedefs for the graph types and iterators
   108   ///Creates convenience typedefs for the graph types and iterators
   109 
   109 
   110   ///\see GRAPH_TYPEDEFS
   110   ///\see GRAPH_TYPEDEFS
   111   ///
   111   ///
   112   ///\note Use this macro, if the graph type is a dependent type,
   112   ///\note Use this macro, if the graph type is a dependent type,
   113   ///ie. the graph type depend on a template parameter.
   113   ///ie. the graph type depend on a template parameter.
   114 #define TEMPLATE_GRAPH_TYPEDEFS(Graph)                                        \
   114 #define TEMPLATE_GRAPH_TYPEDEFS(Graph)                                  \
   115   TEMPLATE_DIGRAPH_TYPEDEFS(Graph);                                        \
   115   TEMPLATE_DIGRAPH_TYPEDEFS(Graph);                                     \
   116   typedef typename Graph::Edge Edge;                                        \
   116   typedef typename Graph::Edge Edge;                                    \
   117   typedef typename Graph::EdgeIt EdgeIt;                                \
   117   typedef typename Graph::EdgeIt EdgeIt;                                \
   118   typedef typename Graph::IncEdgeIt IncEdgeIt;                                \
   118   typedef typename Graph::IncEdgeIt IncEdgeIt;                          \
   119   typedef typename Graph::template EdgeMap<bool> BoolEdgeMap;                \
   119   typedef typename Graph::template EdgeMap<bool> BoolEdgeMap;           \
   120   typedef typename Graph::template EdgeMap<int> IntEdgeMap;                \
   120   typedef typename Graph::template EdgeMap<int> IntEdgeMap;             \
   121   typedef typename Graph::template EdgeMap<double> DoubleEdgeMap
   121   typedef typename Graph::template EdgeMap<double> DoubleEdgeMap
   122 
   122 
   123   /// \brief Function to count the items in the graph.
   123   /// \brief Function to count the items in the graph.
   124   ///
   124   ///
   125   /// This function counts the items (nodes, arcs etc) in the graph.
   125   /// This function counts the items (nodes, arcs etc) in the graph.