PCL
Sorting Algorithms

Template formal parameters: More...

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

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< GaiaStarData >::Sort(), pcl::IndirectArray< MetaObject >::Sort(), and pcl::ReferenceArray< XMLNode >::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::SortedArray< Node * >::Assign(), pcl::IndirectSortedArray< T, A >::Assign(), pcl::ReferenceSortedArray< FileDataCacheItem >::Assign(), pcl::SortedArray< Node * >::Import(), pcl::IndirectSortedArray< T, A >::Import(), pcl::ReferenceSortedArray< FileDataCacheItem >::Import(), pcl::IndirectSortedArray< T, A >::IndirectSortedArray(), pcl::ReferenceSortedArray< FileDataCacheItem >::ReferenceSortedArray(), pcl::GenericVector< bool >::ReverseSort(), pcl::GenericMatrix< coefficient >::ReverseSort(), pcl::GenericVector< bool >::Sort(), pcl::GenericMatrix< coefficient >::Sort(), pcl::GenericString< char, IsoCharTraits, PCL_STRING_ALLOCATOR >::Sort(), pcl::SortedArray< Node * >::SortedArray(), pcl::SortedArray< Node * >::Transfer(), pcl::IndirectSortedArray< T, A >::Transfer(), and pcl::ReferenceSortedArray< FileDataCacheItem >::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().