test/test_tools.h
changeset 1756 b1f441f24d08
parent 1716 d8c28868f074
child 1875 98698b69a902
equal deleted inserted replaced
1:345b46a21ec9 2:8efed2f1aa10
    18 #define LEMON_TEST_TEST_TOOLS_H
    18 #define LEMON_TEST_TEST_TOOLS_H
    19 
    19 
    20 #include <iostream>
    20 #include <iostream>
    21 #include <vector>
    21 #include <vector>
    22 
    22 
       
    23 #include <cstdlib>
       
    24 #include <ctime>
       
    25 
    23 #include <lemon/invalid.h>
    26 #include <lemon/invalid.h>
       
    27 #include <lemon/concept_check.h>
    24 
    28 
    25 using namespace lemon;
    29 using namespace lemon;
    26 
    30 
    27 //! \ingroup misc
    31 //! \ingroup misc
    28 //! \file
    32 //! \file
   168    n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));
   172    n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));
   169   }
   173   }
   170  return n;
   174  return n;
   171 }
   175 }
   172 
   176 
       
   177 int _urandom_init() {
       
   178   int seed = time(0);
       
   179   srand(seed);
       
   180   return seed;
       
   181 }
       
   182 
       
   183 int 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 
   173 #endif
   189 #endif