COIN-OR::LEMON - Graph Library

Changeset 1728:eb8bb91ba9e2 in lemon-0.x for test/test_tools.h


Ignore:
Timestamp:
10/14/05 13:03:40 (15 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2255
Message:

Updating tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_tools.h

    r1716 r1728  
    2121#include <vector>
    2222
     23#include <cstdlib>
     24#include <ctime>
     25
    2326#include <lemon/invalid.h>
     27#include <lemon/concept_check.h>
    2428
    2529using namespace lemon;
     
    171175}
    172176
     177int _urandom_init() {
     178  int seed = time(0);
     179  srand(seed);
     180  return seed;
     181}
     182
     183int urandom(int n) {
     184  static int seed = _urandom_init();
     185  ignore_unused_variable_warning(seed);
     186  return (int)(rand() / (1.0 + RAND_MAX) * n);
     187}
     188
    173189#endif
Note: See TracChangeset for help on using the changeset viewer.