KristofferC / NearestNeighbors.jl

High performance nearest neighbor data structures (KDTree and BallTree) and algorithms for Julia.
Other
413 stars 65 forks source link

Made the result idxs and dists datatypes selectable #161

Open n6171028 opened 1 year ago

n6171028 commented 1 year ago

This changeset enables the user to choose the return data type from the knn function

KristofferC commented 9 months ago

Sorry, I merged some stuff that conflicts with this. For the distances, I think it is ok to do what we currently do and let the input points determine the distance type. Is it really needed to get the distances in e.g. a lower precision than what you tree is built with?

For the integer type I agree it is a good idea to specify it. An alternative to this is to reduce the integer type to the smallest that could fit any index into the input data set. That would make things type unstable though.. But maybe with union splitting it is fine.