From b98d2f68760f638e49cae7e5f2b1199c586210b9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 4 Nov 2019 16:45:30 +0100 Subject: [PATCH] Fix examples --- .../doc/Spatial_sorting/examples.txt | 1 + .../examples/Spatial_sorting/parallel.cpp | 4 +-- Spatial_sorting/include/CGAL/Hilbert_sort_2.h | 2 +- Spatial_sorting/include/CGAL/Hilbert_sort_3.h | 2 +- .../include/CGAL/Hilbert_sort_median_2.h | 1 + .../include/CGAL/Hilbert_sort_on_sphere_3.h | 2 +- Spatial_sorting/include/CGAL/hilbert_sort.h | 34 +++++++++---------- .../include/CGAL/Delaunay_triangulation_3.h | 7 ++-- 8 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Spatial_sorting/doc/Spatial_sorting/examples.txt b/Spatial_sorting/doc/Spatial_sorting/examples.txt index b0d1275d633..557e126b519 100644 --- a/Spatial_sorting/doc/Spatial_sorting/examples.txt +++ b/Spatial_sorting/doc/Spatial_sorting/examples.txt @@ -1,4 +1,5 @@ /*! +\example Spatial_sorting/parallel.cpp \example Spatial_sorting/hilbert.cpp \example Spatial_sorting/hilbert_policies.cpp \example Spatial_sorting/small_example_delaunay_2.cpp diff --git a/Spatial_sorting/examples/Spatial_sorting/parallel.cpp b/Spatial_sorting/examples/Spatial_sorting/parallel.cpp index dd00d063b4b..d198c879275 100644 --- a/Spatial_sorting/examples/Spatial_sorting/parallel.cpp +++ b/Spatial_sorting/examples/Spatial_sorting/parallel.cpp @@ -17,12 +17,12 @@ typedef CGAL::Creator_uniform_3 Creator_3; int main(int argc, char* argv[]) { std::vector points; - v.reserve (2000); + points.reserve (2000); CGAL::Random_points_in_cube_3 gen (1.0); for (int i = 0; i < 2000; ++i){ - v.push_back (*gen++); + points.push_back (*gen++); } #ifdef CGAL_LINKED_WITH_TBB CGAL::spatial_sort(points.begin(),points.end()); diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h index b4e4fa308d1..b784365a176 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h @@ -18,7 +18,7 @@ namespace CGAL { -template +template class Hilbert_sort_2; template diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h index 158937f49e5..486eec6c401 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h @@ -18,7 +18,7 @@ namespace CGAL { - template + template class Hilbert_sort_3; template diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h index 68511bfee5c..a3d176b4d56 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h @@ -13,6 +13,7 @@ #define CGAL_HILBERT_SORT_MEDIAN_2_H #include +#include #include #include #include diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_on_sphere_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_on_sphere_3.h index c45dc9038d3..1ec734a9367 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_on_sphere_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_on_sphere_3.h @@ -42,7 +42,7 @@ class Hilbert_sort_on_sphere_3 { typedef internal::Transform_coordinates_traits_3 Face_5_traits_3; // -z +x typedef internal::Transform_coordinates_traits_3 Face_6_traits_3; // +x +y - Hilbert_sort_2 _hs_1_object; + Hilbert_sort_2 _hs_1_object; Hilbert_sort_2 _hs_2_object; Hilbert_sort_2 _hs_3_object; Hilbert_sort_2 _hs_4_object; diff --git a/Spatial_sorting/include/CGAL/hilbert_sort.h b/Spatial_sorting/include/CGAL/hilbert_sort.h index 13db962df86..0a1e8552e9b 100644 --- a/Spatial_sorting/include/CGAL/hilbert_sort.h +++ b/Spatial_sorting/include/CGAL/hilbert_sort.h @@ -31,7 +31,7 @@ namespace CGAL { namespace internal { - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k, @@ -43,10 +43,10 @@ namespace internal { boost::rand48 random; boost::random_number_generator rng(random); CGAL::cpp98::random_shuffle(begin,end, rng); - (Hilbert_sort_2 (k))(begin, end); + (Hilbert_sort_2 (k))(begin, end); } - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k, @@ -58,10 +58,10 @@ namespace internal { boost::rand48 random; boost::random_number_generator rng(random); CGAL::cpp98::random_shuffle(begin,end, rng); - (Hilbert_sort_3 (k))(begin, end); + (Hilbert_sort_3 (k))(begin, end); } - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k, @@ -75,9 +75,9 @@ namespace internal { CGAL::cpp98::random_shuffle(begin,end, rng); (Hilbert_sort_d (k))(begin, end); } -} +} // namespace internal -template +template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end) { @@ -86,23 +86,23 @@ void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end) typedef CGAL::Kernel_traits KTraits; typedef typename KTraits::Kernel Kernel; - internal::hilbert_sort(begin, end, Kernel(), Hilbert_sort_median_policy(), + internal::hilbert_sort(begin, end, Kernel(), Hilbert_sort_median_policy(), static_cast (0)); } -template +template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k) { typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; - internal::hilbert_sort(begin, end, k, Hilbert_sort_median_policy(), + internal::hilbert_sort(begin, end, k, Hilbert_sort_median_policy(), static_cast (0)); } - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, Hilbert_sort_median_policy policy) { @@ -111,13 +111,13 @@ void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, typedef CGAL::Kernel_traits KTraits; typedef typename KTraits::Kernel Kernel; - internal::hilbert_sort(begin, end, Kernel(), policy, + internal::hilbert_sort(begin, end, Kernel(), policy, static_cast (0)); } - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, Hilbert_sort_middle_policy policy) { @@ -126,21 +126,21 @@ void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, typedef CGAL::Kernel_traits KTraits; typedef typename KTraits::Kernel Kernel; - internal::hilbert_sort(begin, end, Kernel(), policy, + internal::hilbert_sort(begin, end, Kernel(), policy, static_cast (0)); } - template + template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k, Policy policy) { typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; - internal::hilbert_sort(begin, end, - k, policy, static_cast (0)); + internal::hilbert_sort(begin, end, + k, policy, static_cast (0)); } } // namespace CGAL diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 28d2b3f086f..6f6bb69fa2a 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -93,6 +93,7 @@ class Delaunay_triangulation_3 typedef Delaunay_triangulation_3 Self; public: + typedef typename Tds::Concurrency_tag Concurrency_tag; typedef Triangulation_3 Tr_Base; typedef Tds Triangulation_data_structure; @@ -349,7 +350,7 @@ public: size_type n = number_of_vertices(); std::vector points(first, last); - spatial_sort(points.begin(), points.end(), geom_traits()); + spatial_sort(points.begin(), points.end(), geom_traits()); // Parallel #ifdef CGAL_LINKED_WITH_TBB @@ -425,8 +426,8 @@ private: typedef typename Pointer_property_map::type Pmap; typedef Spatial_sort_traits_adapter_3 Search_traits; - spatial_sort(indices.begin(), indices.end(), - Search_traits(make_property_map(points),geom_traits())); + spatial_sort(indices.begin(), indices.end(), + Search_traits(make_property_map(points),geom_traits())); #ifdef CGAL_LINKED_WITH_TBB if(this->is_parallel())