diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Multiscale_sort.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Multiscale_sort.tex index 511c1d877e0..668ef1dc59b 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Multiscale_sort.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Multiscale_sort.tex @@ -14,7 +14,7 @@ stopping when there are less than \ccc{threshold} points. \ccTagFullDeclarations \ccCreationVariable{o} \ccCreation -\ccConstructor{Multiscale_sort (const Sort &sort = Sort(), int threshold = 1, double ratio = 0.5)}{constructs an instance with \ccc{traits} as traits class instance.} +\ccConstructor{Multiscale_sort (const Sort &sort = Sort(), std::ptrdiff_t threshold = 1, double ratio = 0.5)}{constructs an instance with \ccc{traits} as traits class instance.} \ccOperations \ccThree{void;;}{A}{} diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h index a3176c71012..da0617c6608 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h @@ -21,9 +21,8 @@ #define CGAL_HILBERT_SORT_2_H #include - #include - +#include #include CGAL_BEGIN_NAMESPACE @@ -83,13 +82,13 @@ public: private: Kernel _k; - int _limit; + std::ptrdiff_t _limit; template struct Cmp : public CGALi::Hilbert_cmp_2 { Cmp (const Kernel &k) : CGALi::Hilbert_cmp_2 (k) {} }; public: - Hilbert_sort_2 (const Kernel &k = Kernel(), int limit = 1) + Hilbert_sort_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) : _k(k), _limit (limit) {} diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h index 2095b8577cb..ef8d738e8c7 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h @@ -21,9 +21,8 @@ #define CGAL_HILBERT_SORT_3_H #include - #include - +#include #include CGAL_BEGIN_NAMESPACE @@ -97,13 +96,13 @@ public: private: Kernel _k; - int _limit; + std::ptrdiff_t _limit; template struct Cmp : public CGALi::Hilbert_cmp_3 { Cmp (const Kernel &k) : CGALi::Hilbert_cmp_3 (k) {} }; public: - Hilbert_sort_3 (const Kernel &k = Kernel(), int limit = 1) + Hilbert_sort_3 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) : _k(k), _limit (limit) {} diff --git a/Spatial_sorting/include/CGAL/Multiscale_sort.h b/Spatial_sorting/include/CGAL/Multiscale_sort.h index 9716907b935..0a1fbb14bb9 100644 --- a/Spatial_sorting/include/CGAL/Multiscale_sort.h +++ b/Spatial_sorting/include/CGAL/Multiscale_sort.h @@ -21,6 +21,8 @@ #define CGAL_MULTISCALE_SORT_H #include +#include +#include CGAL_BEGIN_NAMESPACE @@ -28,11 +30,11 @@ template class Multiscale_sort { Sort _sort; - int _threshold; + std::ptrdiff_t _threshold; double _ratio; public: - Multiscale_sort (const Sort &sort = Sort(), int threshold = 1, double ratio = 0.5) + Multiscale_sort (const Sort &sort = Sort(), std::ptrdiff_t threshold = 1, double ratio = 0.5) : _sort (sort), _threshold (threshold), _ratio (ratio) { CGAL_precondition (0. <= ratio && ratio <= 1.); @@ -41,9 +43,10 @@ public: template void operator() (RandomAccessIterator begin, RandomAccessIterator end) const { + typedef typename std::iterator_traits::difference_type difference_type; RandomAccessIterator middle = begin; if (end - begin >= _threshold) { - middle = begin + int ((end - begin) * _ratio); + middle = begin + difference_type ((end - begin) * _ratio); this->operator() (begin, middle); } _sort (middle, end); @@ -52,4 +55,4 @@ public: CGAL_END_NAMESPACE -#endif//CGAL_MULTISCALE_SORT_H +#endif // CGAL_MULTISCALE_SORT_H