mirror of https://github.com/CGAL/cgal
renaming nearest_neighbors to nearest_k_neighbors
This commit is contained in:
parent
a8fd56c724
commit
caa833f439
|
|
@ -46,7 +46,7 @@ int main(int argc, char** argv) {
|
|||
};
|
||||
|
||||
for (const Point& p : points_to_find)
|
||||
octree.nearest_neighbors
|
||||
octree.nearest_k_neighbors
|
||||
(p, 1, // k=1 to find the single closest point
|
||||
boost::make_function_output_iterator
|
||||
([&](const Point_set::Index& nearest)
|
||||
|
|
@ -57,7 +57,7 @@ int main(int argc, char** argv) {
|
|||
|
||||
typename Octree::Sphere s(points_to_find[0], 0.0375);
|
||||
std::cout << std::endl << "Closest points within the sphere around " << s.center() << " with squared radius of " << s.squared_radius() << ":" << std::endl;
|
||||
octree.nearest_neighbors
|
||||
octree.neighbors_in_radius
|
||||
(s,
|
||||
boost::make_function_output_iterator
|
||||
([&](const Point_set::Index& nearest)
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ public:
|
|||
\warning Nearest neighbor searches requires `GeomTraits` to be a model of `CollectionPartitioningOrthtreeTraits`.
|
||||
*/
|
||||
template<typename OutputIterator>
|
||||
auto nearest_neighbors(const Point& query,
|
||||
auto nearest_k_neighbors(const Point& query,
|
||||
std::size_t k,
|
||||
OutputIterator output) const -> std::enable_if_t<supports_neighbor_search, OutputIterator> {
|
||||
Sphere query_sphere(query, (std::numeric_limits<FT>::max)());
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void naive_vs_octree(std::size_t dataset_size) {
|
|||
auto octree_start_time = high_resolution_clock::now();
|
||||
{
|
||||
std::vector<Point_set::Index> k_neighbors;
|
||||
octree.nearest_neighbors(random_point, 1, std::back_inserter(k_neighbors));
|
||||
octree.nearest_k_neighbors(random_point, 1, std::back_inserter(k_neighbors));
|
||||
octree_nearest = get(points.point_map(), *k_neighbors.begin());
|
||||
}
|
||||
duration<float> octree_elapsed_time = high_resolution_clock::now() - octree_start_time;
|
||||
|
|
@ -121,7 +121,7 @@ void kdtree_vs_octree(std::size_t dataset_size, std::size_t K) {
|
|||
Octree octree(points, points.point_map());
|
||||
octree.refine(10, 20);
|
||||
auto octree_start_time = high_resolution_clock::now();
|
||||
octree.nearest_neighbors(random_point, K, std::back_inserter(octree_nearest_neighbors));
|
||||
octree.nearest_k_neighbors(random_point, K, std::back_inserter(octree_nearest_neighbors));
|
||||
duration<float> octree_elapsed_time = high_resolution_clock::now() - octree_start_time;
|
||||
|
||||
std::cout << "Octree --> "
|
||||
|
|
|
|||
Loading…
Reference in New Issue