COIN-OR::LEMON - Graph Library

Changeset 2229:4dbb6dd2dd4b in lemon-0.x for test/graph_utils_test.h


Ignore:
Timestamp:
10/02/06 18:11:00 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2969
Message:

Mersenne Twister random number generator

The code is based on the official MT19937 implementation
It is fully rewritten:

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

todo: fixing copyright information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/graph_utils_test.h

    r1956 r2229  
    5151    typedef typename Graph::EdgeIt EdgeIt;
    5252    Graph graph;
    53     srand(time(0));
    5453    for (int i = 0; i < 10; ++i) {
    5554      graph.addNode();
     
    5857    typename DescriptorMap<Graph, Node>::InverseMap invNodes(nodes);
    5958    for (int i = 0; i < 100; ++i) {
    60       int src = (int)(rand() / (RAND_MAX + 1.0) * invNodes.size());
    61       int trg = (int)(rand() / (RAND_MAX + 1.0) * invNodes.size());
     59      int src = rnd.getInt(invNodes.size());
     60      int trg = rnd.getInt(invNodes.size());
    6261      graph.addEdge(invNodes[src], invNodes[trg]);
    6362    }
Note: See TracChangeset for help on using the changeset viewer.