22 #ifndef U32_TABLE_HPP_
23 #define U32_TABLE_HPP_
28 #include "cpc_common.hpp"
32 static const uint32_t U32_TABLE_UPSIZE_NUMER = 3LL;
33 static const uint32_t U32_TABLE_UPSIZE_DENOM = 4LL;
35 static const uint32_t U32_TABLE_DOWNSIZE_NUMER = 1LL;
36 static const uint32_t U32_TABLE_DOWNSIZE_DENOM = 4LL;
41 using vector_u32 = std::vector<uint32_t, typename std::allocator_traits<A>::template rebind_alloc<uint32_t>>;
43 u32_table(
const A& allocator);
44 u32_table(uint8_t lg_size, uint8_t num_valid_bits,
const A& allocator);
46 inline uint32_t get_num_items()
const;
47 inline const uint32_t* get_slots()
const;
48 inline uint8_t get_lg_size()
const;
52 inline bool maybe_insert(uint32_t item);
54 inline bool maybe_delete(uint32_t item);
56 static u32_table make_from_pairs(
const uint32_t* pairs, uint32_t num_pairs, uint8_t lg_k,
const A& allocator);
58 vector_u32 unwrapping_get_items()
const;
61 const uint32_t* arr_a,
size_t start_a,
size_t length_a,
62 const uint32_t* arr_b,
size_t start_b,
size_t length_b,
63 uint32_t* arr_c,
size_t start_c
66 static void introspective_insertion_sort(uint32_t* a,
size_t l,
size_t r);
67 static void knuth_shell_sort3(uint32_t* a,
size_t l,
size_t r);
72 uint8_t num_valid_bits;
76 inline uint32_t lookup(uint32_t item)
const;
77 inline void must_insert(uint32_t item);
78 inline void rebuild(uint8_t new_lg_size);
83 #include "u32_table_impl.hpp"
DataSketches namespace.
Definition: binomial_bounds.hpp:38