Changeset 2242:16523135943d in lemon-0.x for benchmark/swap_bipartite_bench.cc
- Timestamp:
- 10/14/06 17:26:05 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2991
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/swap_bipartite_bench.cc
r2239 r2242 13 13 14 14 #include <lemon/time_measure.h> 15 #include <lemon/random.h> 15 16 16 17 using namespace std; … … 21 22 BPUGRAPH_TYPEDEFS(Graph); 22 23 23 int _urandom_init() {24 int seed = time(0);25 srand(seed);26 return seed;27 }28 29 int urandom(int n) {30 static int seed = _urandom_init();31 ignore_unused_variable_warning(seed);32 return (int)(rand() / (1.0 + RAND_MAX) * n);33 }34 24 35 25 int main() { … … 67 57 for (int i = 0; i < e; ++i) { 68 58 int a,b; 69 Node aNode = aNodes[a= urandom(n)];70 Node bNode = bNodes[b= urandom(m)];59 Node aNode = aNodes[a=rnd[n]]; 60 Node bNode = bNodes[b=rnd[m]]; 71 61 graph.addEdge(aNode, bNode); 72 62 LGraph::Node laNode = laNodes[a];
Note: See TracChangeset
for help on using the changeset viewer.