20 #ifndef CPC_UNION_HPP_
21 #define CPC_UNION_HPP_
25 #include "cpc_sketch.hpp"
26 #include "common_defs.hpp"
42 using vector_bytes = std::vector<uint8_t, typename std::allocator_traits<A>::template rebind_alloc<uint8_t>>;
43 using vector_u64 = std::vector<uint64_t, typename std::allocator_traits<A>::template rebind_alloc<uint64_t>>;
100 using AllocU8 =
typename std::allocator_traits<A>::template rebind_alloc<uint8_t>;
101 using AllocU64 =
typename std::allocator_traits<A>::template rebind_alloc<uint64_t>;
102 using AllocCpc =
typename std::allocator_traits<A>::template rebind_alloc<cpc_sketch_alloc<A>>;
107 vector_u64 bit_matrix;
109 template<
typename S>
void internal_update(S&& sketch);
114 void switch_to_bit_matrix();
115 void walk_table_updating_sketch(
const u32_table<A>& table);
116 void or_table_into_matrix(
const u32_table<A>& table);
117 void or_window_into_matrix(
const vector_bytes& sliding_window, uint8_t offset, uint8_t src_lg_k);
118 void or_matrix_into_matrix(
const vector_u64& src_matrix, uint8_t src_lg_k);
119 void reduce_k(uint8_t new_lg_k);
124 #include "cpc_union_impl.hpp"
High performance C++ implementation of Compressed Probabilistic Counting (CPC) Sketch.
Definition: cpc_sketch.hpp:64
High performance C++ implementation of Compressed Probabilistic Counting (CPC) Union.
Definition: cpc_union.hpp:40
void update(const cpc_sketch_alloc< A > &sketch)
This method is to update the union with a given sketch (lvalue)
Definition: cpc_union_impl.hpp:93
cpc_sketch_alloc< A > get_result() const
This method produces a copy of the current state of the union as a sketch.
Definition: cpc_union_impl.hpp:174
cpc_union_alloc(uint8_t lg_k=cpc_constants::DEFAULT_LG_K, uint64_t seed=DEFAULT_SEED, const A &allocator=A())
Creates an instance of the union given the lg_k parameter and hash seed.
Definition: cpc_union_impl.hpp:30
cpc_union_alloc< A > & operator=(const cpc_union_alloc< A > &other)
Copy assignment.
Definition: cpc_union_impl.hpp:74
const uint8_t DEFAULT_LG_K
default log2 of K
Definition: cpc_common.hpp:36
DataSketches namespace.
Definition: binomial_bounds.hpp:38