Changeset 1728:eb8bb91ba9e2 in lemon-0.x for test/test_tools.h
- Timestamp:
- 10/14/05 13:03:40 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2255
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/test_tools.h
r1716 r1728 21 21 #include <vector> 22 22 23 #include <cstdlib> 24 #include <ctime> 25 23 26 #include <lemon/invalid.h> 27 #include <lemon/concept_check.h> 24 28 25 29 using namespace lemon; … … 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 189 #endif
Note: See TracChangeset
for help on using the changeset viewer.