summaryrefslogtreecommitdiff
path: root/src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp')
-rw-r--r--src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp b/src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp
index 916710ef..0ca35bc6 100644
--- a/src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp
+++ b/src/Spatial_searching/test/test_Spatial_tree_data_structure.cpp
@@ -51,10 +51,10 @@ BOOST_AUTO_TEST_CASE(test_Spatial_tree_data_structure)
Points_ds points_ds(points);
std::size_t closest_pt_index =
- points_ds.query_ANN(points[10], 1, false).begin()->first;
+ points_ds.query_k_nearest_neighbors(points[10], 1, false).begin()->first;
BOOST_CHECK(closest_pt_index == 10);
- auto kns_range = points_ds.query_ANN(points[20], 10, true);
+ auto kns_range = points_ds.query_k_nearest_neighbors(points[20], 10, true);
FT last_dist = -1.;
for (auto const& nghb : kns_range)
@@ -62,4 +62,13 @@ BOOST_AUTO_TEST_CASE(test_Spatial_tree_data_structure)
BOOST_CHECK(nghb.second > last_dist);
last_dist = nghb.second;
}
+
+ auto kfs_range = points_ds.query_k_farthest_neighbors(points[20], 10, true);
+
+ last_dist = kfs_range.begin()->second;
+ for (auto const& nghb : kfs_range)
+ {
+ BOOST_CHECK(nghb.second <= last_dist);
+ last_dist = nghb.second;
+ }
}