CGAL 5.6 - Spatial Sorting
Loading...
Searching...
No Matches
CGAL::Hilbert_sort_2< Traits, PolicyTag, ConcurrencyTag > Class Template Reference

#include <CGAL/Hilbert_sort_2.h>

Definition

template<typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag>
class CGAL::Hilbert_sort_2< Traits, PolicyTag, ConcurrencyTag >

The function object Hilbert_sort_2 sorts iterator ranges of Traits::Point_2 along a Hilbert curve by recursively subdividing at the median or the middle, depending on the PolicyTag (see Section Hilbert Sorting for more information on the policies).

Template Parameters
Traitsmust be a model of the concept SpatialSortingTraits_2.
PolicyTagis used to specify the strategy policy. Possible values are Hilbert_sort_median_policy (the default policy) or Hilbert_sort_middle_policy .
ConcurrencyTagenables sequential versus parallel algorithm. Possible values are Sequential_tag, Parallel_tag, and Parallel_if_available_tag. With parallelism enabled, sorting will be performed using up to four threads. Parallel sorting is available only when the median strategy policy (the default policy) is used.

Creation

 Hilbert_sort_2 (const Traits &traits=Traits())
 constructs an instance with traits as traits class instance.
 

Operations

template<class InputPointIterator >
void operator() (InputPointIterator begin, InputPointIterator end) const
 It sorts the range [begin, end).
 

Member Function Documentation

◆ operator()()

template<typename Traits , typename PolicyTag , typename ConcurrencyTag = Sequential_tag>
template<class InputPointIterator >
void CGAL::Hilbert_sort_2< Traits, PolicyTag, ConcurrencyTag >::operator() ( InputPointIterator  begin,
InputPointIterator  end 
) const

It sorts the range [begin, end).

Template Parameters
InputPointIteratormust be a model of RandomAccessIterator with value type Traits::Point_2.