Template Class RecSplit
Defined in File RecSplit.h
Class Documentation
-
template<class T, unsigned L = 8, class H = DefaultHash<T>>
class RecSplit a minimal perfect hash function of a static set of keys by recursive splitting, with leaves of at most L keys
Public Functions
-
explicit RecSplit(const std::vector<T> &keys, std::size_t b = 100, std::uint64_t seed = 1, H h = H())
the function of the distinct keys, with b keys per bucket on average
- Pre:
the keys are distinct (an audit) and fewer than 2^32, and 1 <= b <= 2000
- Post:
the keys are mapped onto { 0 , … , n - 1 } (an audit)
-
std::size_t operator()(const T &k) const
the value of k, in [ 0 , n ); some value in it for a key out of S
- Pre:
size() >= 1
-
std::size_t size(void) const
the number n of keys
-
bool empty(void) const
-
std::size_t bits(void) const
the bits of the function: the codes, the two Elias-Fano sequences with their directories and the object
-
std::size_t buckets(void) const
the number of buckets
-
std::size_t trials(void) const
the seeds drawn by the build
-
explicit RecSplit(const std::vector<T> &keys, std::size_t b = 100, std::uint64_t seed = 1, H h = H())