diff -r d8475431bbbb -r 8e85e6bbefdf benchmark/hcube.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/benchmark/hcube.cc Mon May 23 04:48:14 2005 +0000 @@ -0,0 +1,106 @@ +// -*- mode:C++ -*- + +#include +#include +#include +#include +#include + +#include"bench_tools.h" + +using namespace std; +using namespace lemon; + +inline int numOfOnes(int n,int dim) +{ + int s=0; + for(int i=0;i>=1; + } + return s; +} + +inline int numOfZeros(int n,int dim) +{ + int s=dim; + for(int i=0;i>=1; + } + return s; +} + +int main(int argc, char *argv[]) +{ + // typedef ListGraph Graph; + typedef SmartGraph Graph; + + ///\bug GRAPH_TYPEDEF_FACTORY(Graph); + GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph); + + Graph G; + + Timer T; + + if(argc!=2) { + cout << "Usage: " << argv[0] << " dim\n"; + return 1; + } + + int dim=atoi(argv[1]); + +// cout << "Creating Hipercube ("<< (1< nodes; + addBiDirHiperCube(G,dim,nodes); + + PrintTime("GENGRAPH",T); + + T.reset(); + Graph::EdgeMap map(G); + for(int i=0;i<5;i++) { + Primes P; + for(int i=0;i Dij(G,map); + for(int i=0;i<10;i++) + Dij.run(nodes[0]); + } + PrintTime("DIJKSTRA",T); + + T.reset(); + { + Graph::EdgeMap flow(G); + + Preflow MF(G,nodes[0],nodes[1<