PCL
Sorting Algorithms

Functions

template<class RI >
void pcl::HeapSort (RI i, RI j)
 
template<class RI , class BP >
void pcl::HeapSort (RI i, RI j, BP p)
 
template<class BI >
void pcl::InsertionSort (BI i, BI j)
 
template<class BI , class BP >
void pcl::InsertionSort (BI i, BI j, BP p)
 
template<class RI >
void pcl::QuickSort (RI i, RI j)
 
template<class RI , class BP >
void pcl::QuickSort (RI i, RI j, BP p)
 
template<class BI >
void pcl::Sort (BI i, BI j)
 
template<class BI , class BP >
void pcl::Sort (BI i, BI j, BP p)
 

Detailed Description

Template formal parameters:

FI Forward iterator
BI Bidirectional iterator
RI Random access iterator
UP Unary predicate
BP Binary predicate
T Item type
F Function

Function Documentation

◆ HeapSort() [1/2]

template<class RI >
void pcl::HeapSort ( RI  i,
RI  j 
)
inline

Generic heap sort algorithm.

Sorts a range [i,j) in ascending order by the heap sort algorithm. Ordering of elements is defined such that for any pair a, b of elements in [i,j) a < b is true if a precedes b.

Definition at line 406 of file Sort.h.

References pcl::ItemType().

◆ HeapSort() [2/2]

template<class RI , class BP >
void pcl::HeapSort ( RI  i,
RI  j,
BP  p 
)
inline

Generic heap sort algorithm.

Sorts a range [i,j) in ascending order by the heap sort algorithm. Ordering of elements is defined such that for any pair a, b of elements in [i,j) the binary predicate p(a,b) is true if a precedes b.

Definition at line 480 of file Sort.h.

References pcl::ItemType().

◆ InsertionSort() [1/2]

template<class BI >
void pcl::InsertionSort ( BI  i,
BI  j 
)
inline

Generic insertion sort algorithm.

Sorts a range [i,j) in ascending order by the insertion sort algorithm. Ordering of elements is defined such that for any pair a, b of elements in [i,j) a < b is true if a precedes b.

Definition at line 110 of file Sort.h.

References pcl::ItemType().

◆ InsertionSort() [2/2]

template<class BI , class BP >
void pcl::InsertionSort ( BI  i,
BI  j,
BP  p 
)
inline

Generic insertion sort algorithm.

Sorts a range [i,j) in ascending order by the insertion sort algorithm. Ordering of elements is defined such that for any pair a, b of elements in [i,j) the binary predicate p(a,b) is true if a precedes b.

Definition at line 141 of file Sort.h.

References pcl::ItemType().

◆ QuickSort() [1/2]

template<class RI >
void pcl::QuickSort ( RI  i,
RI  j 
)
inline

Generic quick sort algorithm.

Sorts a range [i,j) in ascending order by the quick sort algorithm (median of three variant). Ordering of elements is defined such that for any pair a, b of elements in [i,j) a < b is true if a precedes b.

Definition at line 236 of file Sort.h.

References pcl::ItemType().

Referenced by pcl::Array< T, A >::Sort(), pcl::IndirectArray< T, A >::Sort(), and pcl::ReferenceArray< T, A >::Sort().

◆ QuickSort() [2/2]

template<class RI , class BP >
void pcl::QuickSort ( RI  i,
RI  j,
BP  p 
)
inline

Generic quick sort algorithm.

Sorts a range [i,j) in ascending order by the quick sort algorithm (median of three variant). Ordering of elements is defined such that for any pair a, b of elements in [i,j) the binary predicate p(a,b) is true if a precedes b.

Definition at line 332 of file Sort.h.

References pcl::ItemType().

◆ Sort() [1/2]

template<class BI >
void pcl::Sort ( BI  i,
BI  j 
)
inline

Generic sort algorithm.

Sorts a range [i,j) in ascending order. Ordering of elements is defined such that for any pair a, b of elements in [i,j) a < b is true if a precedes b.

This function sorts the specified input sequence employing the fastest (known) sorting algorithm for the iterator class BI. Insertion sort is used for bidirectional iterators without random access, and the quick sort algorithm (median of three variant) is used for random access iterators.

If you want to use the heap sort algorithm instead of quick sort (e.g. for performance testing purposes), define the __PCL_PREFER_HEAPSORT macro.

Definition at line 520 of file Sort.h.

References pcl::IteratorClass().

Referenced by pcl::IndirectSortedArray< T, A >::IndirectSortedArray(), pcl::ReferenceSortedArray< T, A >::ReferenceSortedArray(), pcl::SortedArray< T, A >::SortedArray(), pcl::IndirectSortedArray< T, A >::Assign(), pcl::ReferenceSortedArray< T, A >::Assign(), pcl::SortedArray< T, A >::Assign(), pcl::IndirectSortedArray< T, A >::Import(), pcl::ReferenceSortedArray< T, A >::Import(), pcl::SortedArray< T, A >::Import(), pcl::GenericMatrix< T >::ReverseSort(), pcl::GenericVector< T >::ReverseSort(), pcl::GenericMatrix< T >::Sort(), pcl::GenericString< T, R, A >::Sort(), pcl::GenericVector< T >::Sort(), pcl::IndirectSortedArray< T, A >::Transfer(), pcl::ReferenceSortedArray< T, A >::Transfer(), and pcl::SortedArray< T, A >::Transfer().

◆ Sort() [2/2]

template<class BI , class BP >
void pcl::Sort ( BI  i,
BI  j,
BP  p 
)
inline

Generic sort algorithm.

Sorts a range [i,j) in ascending order. Ordering of elements is defined such that for any pair a, b of elements in [i,j) the binary predicate p(a,b) is true if a precedes b.

This function sorts the specified input sequence employing the fastest (known) sorting algorithm for the iterator class BI. Insertion sort is used for bidirectional iterators without random access, and the quick sort algorithm (median of three variant) is used for random access iterators.

If you want to use the heap sort algorithm instead of quick sort (e.g. for performance testing purposes), define the __PCL_PREFER_HEAPSORT macro.

Definition at line 561 of file Sort.h.

References pcl::IteratorClass().