CGAL 6.1.1 - Spatial Sorting

Loading...
Searching...
No Matches
List of all members
CGAL::Hilbert_sort_2< Traits, PolicyTag, ConcurrencyTag > Class Template Reference
Reference Manual » Function Objects

`#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

  Traits | must be a model of the concept `SpatialSortingTraits_2`.
  PolicyTag | is used to specify the strategy policy. Possible values are `Hilbert_sort_median_policy` (the default policy) or `Hilbert_sort_middle_policy` .
  ConcurrencyTag | enables 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

  InputPointIterator | must be a model of `RandomAccessIterator` with value type `Traits::Point_2`.