Good way to hash a float vector?

后端 未结 7 875
刺人心
刺人心 2020-12-07 21:13

I am well aware of all the problems involved in comparing floats. This is exactly the reason for this question.
I\'m looking to create a fast hash table for values that

7条回答
  •  再見小時候
    2020-12-07 21:42

    don't know how fast this might be, but since you have unit vectors, they all lie on the surface of a sphere. convert to a http://en.wikipedia.org/wiki/Spherical_coordinate_system. then use phi and theta to choose a bucket. there will be no false positives. you can look in the neighboring cells for false negatives.

提交回复
热议问题