From 83cbb3b2f41c024aa6c7377d20fef51b08f26838 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 14:01:07 +0200 Subject: [PATCH] Use CGAL::Random instead of C++11 --- .../include/CGAL/Shape_detection_3/Octree.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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);