Changeset 1756:b1f441f24d08 in lemon0.x
 Timestamp:
 11/02/05 17:32:29 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2288
 Files:

 5 edited
Legend:
 Unmodified
 Added
 Removed

benchmark/bench_tools.h
r1689 r1756 6 6 #include<iostream> 7 7 8 #include<lemon/graph_utils.h> 8 9 #include<lemon/time_measure.h> 9 10 ///An experimental typedef factory11 #define GRAPH_TYPEDEF_FACTORY(Graph) \12 typedef typename Graph:: Node Node;\13 typedef typename Graph:: NodeIt NodeIt;\14 typedef typename Graph:: Edge Edge;\15 typedef typename Graph:: EdgeIt EdgeIt;\16 typedef typename Graph:: InEdgeIt InEdgeIt;\17 typedef typename Graph::OutEdgeIt OutEdgeIt;18 19 #define GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph) \20 typedef Graph:: Node Node;\21 typedef Graph:: NodeIt NodeIt;\22 typedef Graph:: Edge Edge;\23 typedef Graph:: EdgeIt EdgeIt;\24 typedef Graph:: InEdgeIt InEdgeIt;\25 typedef Graph::OutEdgeIt OutEdgeIt;26 27 10 28 11 ///A primitive primtest … … 94 77 void addHyperCube(Graph &G,int dim,std::vector<typename Graph::Node> &nodes) 95 78 { 96 GRAPH_TYPEDEF _FACTORY(Graph);79 GRAPH_TYPEDEFS(typename Graph); 97 80 98 81 std::vector<int> bits(dim+1); … … 110 93 void addBiDirHyperCube(Graph &G,int dim,std::vector<typename Graph::Node>&nodes) 111 94 { 112 GRAPH_TYPEDEF _FACTORY(Graph);95 GRAPH_TYPEDEFS(typename Graph); 113 96 114 97 std::vector<int> bits(dim+1); 
benchmark/bfsbench.cc
r1689 r1756 32 32 void bfsStlQueue(Graph &G,typename Graph::Node source) 33 33 { 34 GRAPH_TYPEDEF _FACTORY(Graph);34 GRAPH_TYPEDEFS(typename Graph); 35 35 36 36 using namespace std; … … 57 57 void bfsOwnQueue(Graph &G,typename Graph::Node source) 58 58 { 59 GRAPH_TYPEDEF _FACTORY(Graph);59 GRAPH_TYPEDEFS(typename Graph); 60 60 61 61 using namespace std; … … 85 85 void iteratorBench(Graph &G) 86 86 { 87 GRAPH_TYPEDEF _FACTORY(Graph);87 GRAPH_TYPEDEFS(typename Graph); 88 88 89 89 int i=0; … … 98 98 typedef SmartGraph Graph; 99 99 100 ///\bug GRAPH_TYPEDEF_FACTORY(Graph); 101 GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph); 100 GRAPH_TYPEDEFS(Graph); 102 101 103 102 Graph G; 
benchmark/graphbench.cc
r1435 r1756 15 15 void makeFullGraph(int n, int rat, int p) 16 16 { 17 GRAPH_TYPEDEF _FACTORY(Graph);17 GRAPH_TYPEDEFS(typename Graph); 18 18 19 19 Graph G; 
benchmark/hcube.cc
r1689 r1756 37 37 typedef SmartGraph Graph; 38 38 39 ///\bug GRAPH_TYPEDEF_FACTORY(Graph); 40 GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph); 39 GRAPH_TYPEDEFS(Graph); 41 40 42 41 Graph G; 
lemon/graph_utils.h
r1730 r1756 41 41 /// @{ 42 42 43 ///Creates convenience typedefs for the graph types and iterators 44 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, 47 ///\c OutEdgeIt. 48 ///\note If \c G it a template parameter, it should be used in this way. 49 ///\code 50 /// GRAPH_TYPEDEFS(typename G) 51 ///\endcode 52 /// 53 ///\warning There are no typedefs for the graph maps because of the lack of 54 ///template typedefs in C++. 55 #define GRAPH_TYPEDEFS(Graph) \ 56 typedef Graph:: Node Node; \ 57 typedef Graph:: NodeIt NodeIt; \ 58 typedef Graph:: Edge Edge; \ 59 typedef Graph:: EdgeIt EdgeIt; \ 60 typedef Graph:: InEdgeIt InEdgeIt; \ 61 typedef Graph::OutEdgeIt OutEdgeIt; 62 63 ///Creates convenience typedefs for the undirected graph types and iterators 64 65 ///This \c \#define creates the same convenience typedefs as defined by 66 ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates 67 ///\c UndirEdge, \c UndirEdgeIt, \c IncEdgeIt, 68 /// 69 ///\note If \c G it a template parameter, it should be used in this way. 70 ///\code 71 /// UNDIRGRAPH_TYPEDEFS(typename G) 72 ///\endcode 73 /// 74 ///\warning There are no typedefs for the graph maps because of the lack of 75 ///template typedefs in C++. 76 #define UNDIRGRAPH_TYPEDEFS(Graph) \ 77 GRAPH_TYPEDEFS(Graph) \ 78 typedef Graph:: UndirEdge UndirEdge; \ 79 typedef Graph:: UndirEdgeIt UndirEdgeIt; \ 80 typedef Graph:: IncEdgeIt IncEdgeIt; 81 82 43 83 /// \brief Function to count the items in the graph. 44 84 ///
Note: See TracChangeset
for help on using the changeset viewer.