// -*- mode:C++ -*- #ifndef LEMON_BENCH_TEST_H #define LEMON_BENCH_TEST_H #include #include #include #include ///A primitive primtest ///\bug 2 is not a prime according to this function! /// ///\bug This function should go out of header file. I'm making it /// inline for now. inline bool isPrim(int n) { if(n%2) { for(int k=3;n/k>=k;k+=2) if(!(n%k)) return false; return true; } return false; } ///Finds the smallest prime not less then \c n. ///\bug This function should go out of header file. I'm making it /// inline for now. inline int nextPrim(int n) { for(n+=!(n%2);!isPrim(n);n+=2) ; return n; } /// Class to generate consecutive primes class Primes { std::vector primes; int n; bool isPrime(int m) { for(int i=0;m void addHyperCube(Graph &G,int dim,std::vector &nodes) { GRAPH_TYPEDEFS(typename Graph); std::vector bits(dim+1); bits[0]=1; for(int i=1;i<=dim;i++) bits[i]=2*bits[i-1]; for(int i=0;i void addBiDirHyperCube(Graph &G,int dim,std::vector&nodes) { GRAPH_TYPEDEFS(typename Graph); std::vector bits(dim+1); bits[0]=1; for(int i=1;i<=dim;i++) bits[i]=2*bits[i-1]; for(int i=0;i