62 #define __PCL_QS_STACK_SIZE 32
63 #define __PCL_QS_IS_THRESHOLD 11
86 template <
class BI,
class T>
inline
87 void __pcl_insertion_sort__( BI i, BI j,
const T* )
90 for ( BI k = i; ++k != j; )
94 for ( BI x = y; y != i && v < *--x; --y )
109 template <
class BI>
inline
112 __pcl_insertion_sort__( i, j,
ItemType( i ) );
117 template <
class BI,
class BP,
class T>
inline
118 void __pcl_insertion_sort__( BI i, BI j, BP p,
const T* )
121 for ( BI k = i; ++k != j; )
125 for ( BI x = y; y != i && p( v, *--x ); --y )
140 template <
class BI,
class BP>
inline
143 __pcl_insertion_sort__( i, j, p,
ItemType( i ) );
148 template <
class RI,
class T>
inline
149 void __pcl_quick_sort__( RI i, RI j, T* )
163 if ( r-l < __PCL_QS_IS_THRESHOLD )
165 for ( RI x = x0; ++x <= y; )
169 for ( ; --x1 >= x0 && v < *x1; )
184 Swap( *++x, *(i + ((l+r) >> 1)) );
210 if ( r-dx+1 >= dy-l )
235 template <
class RI>
inline
238 __pcl_quick_sort__( i, j,
ItemType( i ) );
243 template <
class RI,
class BP,
class T>
inline
244 void __pcl_quick_sort__( RI i, RI j, BP p, T* )
258 if ( r-l < __PCL_QS_IS_THRESHOLD )
260 for ( RI x = x0; ++x <= y; )
264 for ( ; --x1 >= x0 && p( v, *x1 ); )
279 Swap( *++x, *(i + ((l+r) >> 1)) );
292 while ( p( *++x, v ) );
293 while ( p( v, *--y ) );
305 if ( r-dx+1 >= dy-l )
331 template <
class RI,
class BP>
inline
334 __pcl_quick_sort__( i, j, p,
ItemType( i ) );
339 template <
class RI,
class T>
inline
340 void __pcl_heap_sort__( RI i, RI j, T* )
349 for ( i += di-1, --j; ; )
373 for (
distance_type dy2 = di, dy = di; !(dj < (dy <<= 1)); dy2 = dy )
377 if ( dy < dj && *y < *(y+1) )
405 template <
class RI>
inline
408 __pcl_heap_sort__( i, j,
ItemType( i ) );
413 template <
class RI,
class BP,
class T>
inline
414 void __pcl_heap_sort__( RI i, RI j, BP p, T* )
423 for ( i += di-1, --j; ; )
447 for (
distance_type dy2 = di, dy = di; !(dj < (dy <<= 1)); dy2 = dy )
451 if ( dy < dj && p( *y, *(y+1) ) )
479 template <
class RI,
class BP>
inline
482 __pcl_heap_sort__( i, j, p,
ItemType( i ) );
487 template <
class BI>
inline
488 void __pcl_sort__( BI i, BI j, BidirectionalIterator )
493 template <
class RI>
inline
494 void __pcl_sort__( RI i, RI j, RandomAccessIterator )
496 #ifdef __PCL_PREFER_HEAPSORT
519 template <
class BI>
inline
527 template <
class BI,
class BP>
inline
528 void __pcl_sort__( BI i, BI j, BP p, BidirectionalIterator )
533 template <
class RI,
class BP>
inline
534 void __pcl_sort__( RI i, RI j, BP p, RandomAccessIterator )
536 #ifdef __PCL_PREFER_HEAPSORT
560 template <
class BI,
class BP>
inline
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
void HeapSort(RI i, RI j)
void InsertionSort(BI i, BI j)
void QuickSort(RI i, RI j)
C IteratorClass(const Iterator< C, T > &)
T * ItemType(const Iterator< C, T > &)