File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
registration/include/pcl/registration Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,18 @@ class PCL_EXPORTS PPFHashMapSearch {
6767 std::size_t
6868 operator ()(const HashKeyStruct& s) const noexcept
6969 {
70- const std::size_t h1 = std::hash<int >{}(s.first );
71- const std::size_t h2 = std::hash<int >{}(s.second .first );
72- const std::size_t h3 = std::hash<int >{}(s.second .second .first );
73- const std::size_t h4 = std::hash<int >{}(s.second .second .second );
74- return h1 ^ (h2 << 1 ) ^ (h3 << 2 ) ^ (h4 << 3 );
70+ // / RS hash function https://www.partow.net/programming/hashfunctions/index.html
71+ std::size_t b_ = 378551 ;
72+ std::size_t a_ = 63689 ;
73+ std::size_t hash = 0 ;
74+ hash = hash * a_ + s.first ;
75+ a_ = a_ * b_;
76+ hash = hash * a_ + s.second .first ;
77+ a_ = a_ * b_;
78+ hash = hash * a_ + s.second .second .first ;
79+ a_ = a_ * b_;
80+ hash = hash * a_ + s.second .second .second ;
81+ return hash;
7582 }
7683 };
7784 using FeatureHashMapType =
You can’t perform that action at this time.
0 commit comments