summaryrefslogtreecommitdiffstats
path: root/src/vp.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-07-06 22:24:02 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-07-06 22:33:10 -0400
commit5f85a59d4be37d350bcf1ee62c25ac1f84d71770 (patch)
tree8fc7ea8e59226c5e677d7b9aef39b0b2be5f28b7 /src/vp.rs
parented4d7b7143f1a8a9602698ca3e60e18bbb4dd226 (diff)
downloadacap-5f85a59d4be37d350bcf1ee62c25ac1f84d71770.tar.xz
kd: Use a more traditional k-d tree implementation
The slight extra pruning possible in the previous implementation didn't seem to be worth it. The new, simpler implementation is also about 30% faster in most of the benchmarks. This gets rid of Coordinate{Proximity,Metric} as they're not necessary any more (and the old ExactNeighbors impl was too restrictive anyway).
Diffstat (limited to 'src/vp.rs')
-rw-r--r--src/vp.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vp.rs b/src/vp.rs
index 85d3972..c44b323 100644
--- a/src/vp.rs
+++ b/src/vp.rs
@@ -532,16 +532,16 @@ where
mod tests {
use super::*;
- use crate::tests::test_nearest_neighbors;
+ use crate::tests::test_exact_neighbors;
#[test]
fn test_vp_tree() {
- test_nearest_neighbors(VpTree::from_iter);
+ test_exact_neighbors(VpTree::from_iter);
}
#[test]
fn test_unbalanced_vp_tree() {
- test_nearest_neighbors(|points| {
+ test_exact_neighbors(|points| {
let mut tree = VpTree::new();
for point in points {
tree.push(point);
@@ -552,6 +552,6 @@ mod tests {
#[test]
fn test_flat_vp_tree() {
- test_nearest_neighbors(FlatVpTree::from_iter);
+ test_exact_neighbors(FlatVpTree::from_iter);
}
}