kiddo_v1 icon indicating copy to clipboard operation
kiddo_v1 copied to clipboard

Integer as key

Open ShuP1 opened this issue 2 years ago • 2 comments

Is support for discrete index type planned ?

Using u32 as dimension can be useful in many fields. My usage is a sparse 3d grid for discrete physics simulation.

ShuP1 avatar May 31 '22 17:05 ShuP1

This would be nice to have. The problem at the moment is the Float trait bound on the generic type used for the coordinate system](https://github.com/sdd/kiddo/blob/master/src/kiddo.rs#L82). This is needed due to the use of A::infinity() and A::negative_infinity() for boundary conditions, which are not available for primitive integer types.

We could have multiple impl<A, T: std::cmp::PartialEq, const K: usize> KdTree<A, T, K>blocks, with each having different bounds forA`: the existing one for floats, one for unsigned ints, and one for signed ints.

I'm a bit busy to take this on myself at the moment, but happy to consider submissions from anyone who wants to take a crack at this.

sdd avatar Jul 13 '22 06:07 sdd

This is now available in the v2 version of Kiddo which is currently in beta.

sdd avatar Feb 17 '23 16:02 sdd