COIN-OR::LEMON - Graph Library

Changeset 2242:16523135943d in lemon-0.x for demo/descriptor_map_demo.cc


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
  • demo/descriptor_map_demo.cc

    r2207 r2242  
    3333#include <lemon/graph_to_eps.h>
    3434
     35#include <lemon/random.h>
     36
    3537#include <iostream>
    3638
    37 #include <cstdlib>
    3839#include <cmath>
    39 #include <ctime>
     40
    4041
    4142using namespace lemon;
     
    7677
    7778int main() {
    78   std::srand(std::time(0));
    7979  typedef ListGraph Graph;
    8080  typedef Graph::Node Node;
     
    106106  const int EDGE = (int)(NODE * std::log(double(NODE)));
    107107  for (int i = 0; i < EDGE; ++i) {
    108     int si = (int)(std::rand() / (RAND_MAX + 1.0) * NODE);
    109     int ti = (int)(std::rand() / (RAND_MAX + 1.0) * NODE);
     108    int si = rnd[NODE];
     109    int ti = rnd[NODE];
    110110     
    111111    graph.addEdge(nodeInv[si], nodeInv[ti]);
Note: See TracChangeset for help on using the changeset viewer.