COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
10/14/06 17:26:05 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2991
Message:

New random interface
Switching to the new interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/swap_bipartite_bench.cc

    r2239 r2242  
    1313
    1414#include <lemon/time_measure.h>
     15#include <lemon/random.h>
    1516
    1617using namespace std;
     
    2122BPUGRAPH_TYPEDEFS(Graph);
    2223
    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 }
    3424
    3525int main() {
     
    6757      for (int i = 0; i < e; ++i) {
    6858        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]];
    7161        graph.addEdge(aNode, bNode);
    7262        LGraph::Node laNode = laNodes[a];
Note: See TracChangeset for help on using the changeset viewer.