COIN-OR::LEMON - Graph Library

Changeset 2242:16523135943d in lemon-0.x for test/radix_sort_test.cc


Ignore:
Timestamp:
10/14/06 17:26:05 (15 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
  • test/radix_sort_test.cc

    r1956 r2242  
    3838    vector<int> data1(n), data2(n);
    3939    for (int i = 0; i < n; ++i) {
    40       data1[i] = data2[i] = (int)(1000 * (rand() / (RAND_MAX + 1.0))) - 500;
     40      data1[i] = data2[i] = rnd[1000] - 500;
    4141    }
    4242    radixSort(data1.begin(), data1.end());
     
    4949    vector<unsigned char> data1(n), data2(n);
    5050    for (int i = 0; i < n; ++i) {
    51       data1[i] = data2[i] = (int)(200 * (rand() / (RAND_MAX + 1.0)));
     51      data1[i] = data2[i] = rnd[(unsigned char)200];
    5252    }
    5353    radixSort(data1.begin(), data1.end());
     
    6565    vector<int> data1(n), data2(n);
    6666    for (int i = 0; i < n; ++i) {
    67       data1[i] = data2[i] = (int)(1000 * (rand() / (RAND_MAX + 1.0))) - 500;
     67      data1[i] = data2[i] = rnd[1000] - 500;
    6868    }
    6969    counterSort(data1.begin(), data1.end());
     
    7676    vector<unsigned char> data1(n), data2(n);
    7777    for (int i = 0; i < n; ++i) {
    78       data1[i] = data2[i] = (int)(200 * (rand() / (RAND_MAX + 1.0)));
     78      data1[i] = data2[i] = rnd[(unsigned char)200];
    7979    }
    8080    counterSort(data1.begin(), data1.end());
     
    107107  vector<Edge> edges;
    108108  for (int i = 0; i < e; ++i) {
    109     int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
    110     int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
     109    int s = rnd[n];
     110    int t = rnd[n];
    111111    edges.push_back(graph.addEdge(nodes[s], nodes[t]));
    112112  }
     
    146146  vector<Edge> edges;
    147147  for (int i = 0; i < e; ++i) {
    148     int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
    149     int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
     148    int s = rnd[n];
     149    int t = rnd[n];
    150150    edges.push_back(graph.addEdge(nodes[s], nodes[t]));
    151151  }
Note: See TracChangeset for help on using the changeset viewer.