52 #ifndef __PCL_Selection_h
53 #define __PCL_Selection_h
83 template <
class RI,
typename T>
inline
87 if ( k < 0 || n < 1 || n <= k )
97 if ( r == l+1 && *y < *x0 )
104 Swap( *++x, *(i + ((l+r) >> 1)) );
164 template <
class RI>
inline
167 return __pcl_quick_select__( i, j, k,
ItemType( i ) );
172 template <
class RI,
class BP,
class T>
inline
173 RI __pcl_quick_select__( RI i, RI j,
distance_type k, BP p, T* )
176 if ( k < 0 || n < 1 || n <= k )
186 if ( r == l+1 && p( *y, *x0 ) )
193 Swap( *++x, *(i + ((l+r) >> 1)) );
206 while ( p( *++x, v ) );
207 while ( p( v, *--y ) );
237 template <
class RI,
class BP>
inline
240 return __pcl_quick_select__( i, j, k, p,
ItemType( i ) );
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
RI Select(RI i, RI j, distance_type k)
T * ItemType(const Iterator< C, T > &)