From fbc8e81de32f44caef59c3bfc0b814abb8ff0109 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 30 Apr 2024 15:18:34 +0200 Subject: [PATCH] Add method partitioned_phf::position This mirrors single_phf::position and allows users to run the hasher themselves --- include/partitioned_phf.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/partitioned_phf.hpp b/include/partitioned_phf.hpp index 07aadc3..3eef119 100644 --- a/include/partitioned_phf.hpp +++ b/include/partitioned_phf.hpp @@ -93,6 +93,10 @@ struct partitioned_phf { template uint64_t operator()(T const& key) const { auto hash = Hasher::hash(key, m_seed); + return position(hash); + } + + uint64_t position(typename Hasher::hash_type hash) const { auto b = m_bucketer.bucket(hash.mix()); auto const& p = m_partitions[b]; return p.offset + p.f.position(hash);