Changeset 711:b6c56353832c in lemon-0.x for src/benchmark/graph-bench.cc
- Timestamp:
- 07/20/04 11:50:11 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@963
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/graph-bench.cc
r708 r711 3 3 #include<hugo/time_measure.h> 4 4 #include<iostream> 5 #include<sage_graph.h> 6 #include <vector>5 6 #include"bench_tools.h" 7 7 8 8 using namespace hugo; 9 10 ///An experimental typedef factory11 #define GRAPH_TYPEDEF_FACTORY(Graph) \12 typedef typename Graph:: Node Node;\13 typedef typename Graph:: NodeIt NodeIn;\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 20 ///A primitive primtest21 bool isPrim(int n)22 {23 if(n%2) {24 for(int k=3;n/k>=k;k+=2)25 if(!(n%k)) return false;26 return true;27 }28 return false;29 }30 31 ///Finds the smallest prime not less then \c n.32 int nextPrim(int n)33 {34 for(n+=!(n%2);!isPrim(n);n+=2) ;35 return n;36 }37 9 38 10 ///Makes a full graph by adding and deleting a lot of edges;
Note: See TracChangeset
for help on using the changeset viewer.