diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h index 47dd06f0d61..3e8023ec901 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h @@ -23,9 +23,9 @@ #define CGAL_SHAPE_DETECTION_3_OCTREE_H #include -#include #include +#include #include #include @@ -455,9 +455,7 @@ namespace CGAL { std::set& indices, const std::vector& shapeIndex, std::size_t requiredSamples) { - static std::random_device rd; - static std::mt19937 rng(rd()); - static std::uniform_int_distribution<> dis(0, this->size() - 1); + static CGAL::Random rand; bool upperZ, upperY, upperX; Cell *cur = m_root; @@ -491,7 +489,7 @@ namespace CGAL { } if (enough >= requiredSamples) { do { - std::size_t p = dis(rng) % cur->size(); + std::size_t p = rand.get_int(0, cur->size() - 1); std::size_t j = this->index(cur->first + p); if (shapeIndex[j] == -1) indices.insert(j);