11 struct compareByDistance
15 return ( p1.second < p2.second );
28 std::vector < GlobalPoint >
pts; pts.reserve ( values.size()-1 );
29 std::vector< PointAndDistance> sorted_values ( values.size() );
30 partial_sort_copy ( values.begin(), values.end(),
31 sorted_values.begin(), sorted_values.end(), compareByDistance() );
33 std::vector< PointAndDistance>::iterator
end = sorted_values.end();
34 std::vector< PointAndDistance>::iterator
begin = sorted_values.begin();
39 unsigned int min_num = values.size() < 30 ? values.size() : 30;
42 if ( values.size() > 2 * min_num ) min_num = (
int) values.size() / 2;
44 while ( pts.size() < min_num )
47 std::vector< PointAndDistance>::iterator
i;
48 for ( i=begin; i!=end && ( i->second < dmax ) ; ++
i )
50 pts.push_back ( i->first );
std::pair< GlobalPoint, float > PointAndDistance
GlobalPoint hsm_3d(const std::vector< GlobalPoint > &values)
cordinate wise half sample mode in 3d
std::pair< GlobalPoint, float > PointAndDistance
GlobalPoint operator()(const std::vector< PointAndDistance > &values) const override
static const double pts[33]
SubsetHsmModeFinder3d * clone() const override