# Changeset 711:b6c56353832c in lemon-0.x

Ignore:
Timestamp:
07/20/04 11:50:11 (20 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@963
Message:

Some tools of common usage was put to bench_tool.h

Location:
src/benchmark
Files:
1 added
3 edited

Unmodified
Added
Removed
• ## src/benchmark/Makefile.am

 r708 noinst_PROGRAMS = graph-bench hcube graph_bench_SOURCES = graph-bench.cc graph_bench_SOURCES = graph-bench.cc bench_tools.h hcube_SOURCES = hcube.cc hcube_SOURCES = hcube.cc bench_tools.h
• ## src/benchmark/graph-bench.cc

 r708 #include #include #include #include #include"bench_tools.h" using namespace hugo; ///An experimental typedef factory #define GRAPH_TYPEDEF_FACTORY(Graph) \ typedef typename Graph::   Node      Node;\ typedef typename Graph::   NodeIt    NodeIn;\ typedef typename Graph::   Edge      Edge;\ typedef typename Graph::   EdgeIt    EdgeIt;\ typedef typename Graph:: InEdgeIt  InEdgeIt;\ typedef typename Graph::OutEdgeIt OutEdgeIt; ///A primitive primtest 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. int nextPrim(int n) { for(n+=!(n%2);!isPrim(n);n+=2) ; return n; } ///Makes a full graph by adding and deleting a lot of edges;
• ## src/benchmark/hcube.cc

 r708 #include #include #include<../work/jacint/max_flow.h> //#include<../work/jacint/max_flow.h> #include"bench_tools.h" using namespace std; using namespace hugo; ///An experimental typedef factory #define GRAPH_TYPEDEF_FACTORY(Graph) \ typedef typename Graph::   Node      Node;\ typedef typename Graph::   NodeIt    NodeIn;\ typedef typename Graph::   Edge      Edge;\ typedef typename Graph::   EdgeIt    EdgeIt;\ typedef typename Graph:: InEdgeIt  InEdgeIt;\ typedef typename Graph::OutEdgeIt OutEdgeIt; #define GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph) \ typedef Graph::   Node      Node;\ typedef Graph::   NodeIt    NodeIn;\ typedef Graph::   Edge      Edge;\ typedef Graph::   EdgeIt    EdgeIt;\ typedef Graph:: InEdgeIt  InEdgeIt;\ typedef Graph::OutEdgeIt OutEdgeIt; class Primes { vector primes; int n; bool isPrime(int m) { for(int i=0;m
Note: See TracChangeset for help on using the changeset viewer.