mirror of https://github.com/CGAL/cgal
commit
bf027d4154
|
|
@ -12,6 +12,7 @@
|
|||
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||
#include <CGAL/Polygon_2.h>
|
||||
#include <CGAL/Real_timer.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
|
@ -61,7 +62,7 @@ int main(int argc, char** argv)
|
|||
|
||||
// below is only used for random weight generation
|
||||
double min_weight = 1., max_weight = 10.;
|
||||
int seed = std::time(nullptr);
|
||||
int seed = CGAL::get_default_random().get_seed();
|
||||
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ void generate_random_weights(const PolygonWithHoles& p,
|
|||
using Container = typename std::remove_reference<decltype(c)>::type;
|
||||
using Iterator = typename Container::const_iterator;
|
||||
|
||||
std::map<Iterator, std::size_t /*rnd weight*/> weight;
|
||||
std::map<Iterator, FT> weight;
|
||||
|
||||
// start somewhere not collinear
|
||||
Iterator start_it;
|
||||
|
|
@ -238,7 +238,7 @@ void generate_random_weights(const PolygonWithHoles& p,
|
|||
else
|
||||
{
|
||||
CGAL_assertion(weight.count(it) == 0);
|
||||
weight[it] = rnd.get_double(min_weight, max_weight);
|
||||
weight[it] = FT(rnd.get_double(min_weight, max_weight));
|
||||
}
|
||||
|
||||
it = next(it, c);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ int main(int argc, char** argv)
|
|||
|
||||
int hole_n = (argc > 1) ? std::atoi(argv[1]) : 2;
|
||||
int hole_nv = (argc > 2) ? std::atoi(argv[2]) : 10;
|
||||
int seed = (argc > 3) ? std::atoi(argv[3]) : std::time(nullptr);
|
||||
int seed = (argc > 3) ? std::atoi(argv[3]) : CGAL::get_default_random().get_seed();
|
||||
|
||||
CGAL::Random rnd(seed);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue