13 #ifndef THRILL_CORE_HYPERLOGLOG_HEADER 14 #define THRILL_CORE_HYPERLOGLOG_HEADER 39 size_t size()
const {
return entries_.size(); }
43 bool shouldConvertToDense();
46 template <
typename ValueType>
52 void insert_hash(
const uint64_t& hash_value);
66 template <
typename Archive,
typename T,
typename Enable>
70 unsigned sparse_size_ = 0;
83 namespace hyperloglog {
85 template <
size_t sparsePrecision,
size_t densePrecision>
88 template <
size_t sparsePrecision,
size_t densePrecision>
92 std::vector<uint8_t>
encodeSparseList(
const std::vector<uint32_t>& sparseList);
93 std::vector<uint32_t>
decodeSparseList(
const std::vector<uint8_t>& sparseList);
100 template <
typename Archive,
size_t p>
106 static constexpr
bool is_fixed_size =
false;
107 static constexpr
size_t fixed_size = 0;
113 #endif // !THRILL_CORE_HYPERLOGLOG_HEADER
HyperLogLogRegisterFormat
std::pair< size_t, uint8_t > decodeHash(HyperLogLogSparseRegister reg)
uint32_t HyperLogLogSparseRegister
std::vector< uint8_t > sparseListBuffer_
void insert(const ValueType &value)
std::vector< uint32_t > decodeSparseList(const std::vector< uint8_t > &sparseList)
static uint64_t siphash(const uint8_t key[16], const uint8_t *msg, size_t size)
HyperLogLogRegisterFormat format_
std::vector< HyperLogLogSparseRegister > deltaSet_
std::vector< uint8_t > entries_
uint32_t encodeHash(uint64_t hash)
std::vector< uint8_t > encodeSparseList(const std::vector< uint32_t > &sparseList)
Perform a varint and a difference encoding.
HashCrc32< T > hash
Select a hashing method.