You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a KdTree<FixedI32<U0>, usize, 2, 32, u32>. When I want to use squared_euclidean as distance_fn, I get an overflow. Would it be possible to support FixedI64 as distance_fn return type?
Currently, I work around it by using KdTree<FixedI64<U0>,...>, which seems wasteful.
The text was updated successfully, but these errors were encountered:
Hi Michael. That's a good point. When I used FixedU16 I was having to sacrifice some precision in order to ensure that the distance would not overflow, which is not ideal.
Getting this working generically will be interesting - I'll have a think about how it could be done. Any suggestions or PRs appreciated, if you have some ideas.
Again with the RGB color information. Since RGB values can be stored in a U8F0, I tried using that as coordinate type, but distances are frequently higher than 255 even with the Manhattan distance function, which forces me to use a U16F0 because of this issue.
I would say, to fix this, maybe just always set the distance type to a FixedU64 with the given bits of precision? Or calculate the maximum distance for the given coordinate type and distance function, and pick the smallest FixedUx that will fit; not sure if that's worth it though.
I have a
KdTree<FixedI32<U0>, usize, 2, 32, u32>
. When I want to usesquared_euclidean
asdistance_fn
, I get an overflow. Would it be possible to supportFixedI64
asdistance_fn
return type?Currently, I work around it by using
KdTree<FixedI64<U0>,...>
, which seems wasteful.The text was updated successfully, but these errors were encountered: