Turn on '-Wall' by default.
2 #ifndef HUGO_BENCH_TEST_H
3 #define HUGO_BENCH_TEST_H
7 ///An experimental typedef factory
8 #define GRAPH_TYPEDEF_FACTORY(Graph) \
9 typedef typename Graph:: Node Node;\
10 typedef typename Graph:: NodeIt NodeIn;\
11 typedef typename Graph:: Edge Edge;\
12 typedef typename Graph:: EdgeIt EdgeIt;\
13 typedef typename Graph:: InEdgeIt InEdgeIt;\
14 typedef typename Graph::OutEdgeIt OutEdgeIt;
16 #define GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph) \
17 typedef Graph:: Node Node;\
18 typedef Graph:: NodeIt NodeIn;\
19 typedef Graph:: Edge Edge;\
20 typedef Graph:: EdgeIt EdgeIt;\
21 typedef Graph:: InEdgeIt InEdgeIt;\
22 typedef Graph::OutEdgeIt OutEdgeIt;
25 ///A primitive primtest
29 for(int k=3;n/k>=k;k+=2)
30 if(!(n%k)) return false;
36 ///Finds the smallest prime not less then \c n.
39 for(n+=!(n%2);!isPrim(n);n+=2) ;
44 /// Class to generate consecutive primes
47 std::vector<int> primes;
52 for(int i=0;m<primes[i]*primes[i];i++) if(!(m%primes[i])) return false;
60 if(primes.size()==0) {
65 do n+=2; while(!isPrime(n));