From e19823ab7275199caee037d75c6a3c7d6945a628 Mon Sep 17 00:00:00 2001 From: Saurabh Gupta Date: Tue, 9 Jul 2024 12:58:36 +0000 Subject: [PATCH] Remove redundant Modulus operation for Voxel Hash function (#358) * Make voxel computation consistent across all source code, also use std::floor to have explicit control over type casting * Use available function for conversion * Remove redundant Modulus operation for Vocel Hash function, set robin map params instead * Make it a one liner * remove numeric from includes * New proposal * remove numeric from include * shrink diff * Consistency as always * Split changes into two PRs * Revert "Merge remote-tracking branch 'origin' into gupta_fix_hash" This reverts commit 6e46c0d148213f7f80264909ed1ec89975891c9c, reversing changes made to 07634eb40541db676eb38a1383746329e5f795bd. --------- Co-authored-by: tizianoGuadagnino Co-authored-by: Ignacio Vizzo --- cpp/kiss_icp/core/VoxelHashMap.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/core/VoxelHashMap.hpp b/cpp/kiss_icp/core/VoxelHashMap.hpp index 92a3d167..8ffe9ed9 100644 --- a/cpp/kiss_icp/core/VoxelHashMap.hpp +++ b/cpp/kiss_icp/core/VoxelHashMap.hpp @@ -46,7 +46,7 @@ struct VoxelHashMap { struct VoxelHash { size_t operator()(const Voxel &voxel) const { const uint32_t *vec = reinterpret_cast(voxel.data()); - return ((1 << 20) - 1) & (vec[0] * 73856093 ^ vec[1] * 19349669 ^ vec[2] * 83492791); + return (vec[0] * 73856093 ^ vec[1] * 19349669 ^ vec[2] * 83492791); } };