sdd / kiddo

Kiddo
Apache License 2.0
87 stars 14 forks source link

Question: Must the number of points per input be known at compile time? #178

Closed NnannaOmoke closed 4 weeks ago

NnannaOmoke commented 1 month ago

This means that you cannot build a KdTree from a vector of vectors/slices, which severely limits the functionality to use cases where the dimensions of the input are hard coded in.

NnannaOmoke commented 1 month ago

i.e. something like this would not work:

let tree = points.rows().into_iter().map(|row| row.to_vec()).collect::<Vec<Vec<f64>>>();
//assume that points is an `ndarray`
let tree = KdTree<f64, 2> = (&tree).into();

Even though this is a very points agnostic way of creating KdTrees

sdd commented 4 weeks ago

Unfortunately yes, Kiddo does not support creating trees whose dimensionality is not known at compile time. This is due to the use of arrays rather than Vecs for performance.