equal
deleted
inserted
replaced
25 #include <cstdlib> |
25 #include <cstdlib> |
26 #include <ctime> |
26 #include <ctime> |
27 |
27 |
28 #include <lemon/concept_check.h> |
28 #include <lemon/concept_check.h> |
29 #include <lemon/concept/graph.h> |
29 #include <lemon/concept/graph.h> |
|
30 |
|
31 #include <lemon/random.h> |
30 |
32 |
31 using namespace lemon; |
33 using namespace lemon; |
32 |
34 |
33 //! \ingroup misc |
35 //! \ingroup misc |
34 //! \file |
36 //! \file |
174 n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5])); |
176 n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5])); |
175 } |
177 } |
176 return n; |
178 return n; |
177 } |
179 } |
178 |
180 |
179 int _urandom_init() { |
|
180 int seed = time(0); |
|
181 srand(seed); |
|
182 return seed; |
|
183 } |
|
184 |
|
185 int urandom(int n) { |
181 int urandom(int n) { |
186 static int seed = _urandom_init(); |
182 return rnd.getInt(n); |
187 ignore_unused_variable_warning(seed); |
|
188 return (int)(rand() / (1.0 + RAND_MAX) * n); |
|
189 } |
183 } |
190 |
184 |
191 #endif |
185 #endif |