datasketches-cpp
|
Update Tuple sketch. More...
#include <tuple_sketch.hpp>
Classes | |
class | builder |
Update Tuple sketch builder. More... | |
Public Member Functions | |
virtual Allocator | get_allocator () const |
virtual bool | is_empty () const |
virtual bool | is_ordered () const |
virtual uint64_t | get_theta64 () const |
virtual uint32_t | get_num_retained () const |
virtual uint16_t | get_seed_hash () const |
uint8_t | get_lg_k () const |
resize_factor | get_rf () const |
template<typename FwdUpdate > | |
void | update (const std::string &key, FwdUpdate &&value) |
Update this sketch with a given string. More... | |
template<typename FwdUpdate > | |
void | update (uint64_t key, FwdUpdate &&value) |
Update this sketch with a given unsigned 64-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (int64_t key, FwdUpdate &&value) |
Update this sketch with a given signed 64-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (uint32_t key, FwdUpdate &&value) |
Update this sketch with a given unsigned 32-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (int32_t key, FwdUpdate &&value) |
Update this sketch with a given signed 32-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (uint16_t key, FwdUpdate &&value) |
Update this sketch with a given unsigned 16-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (int16_t key, FwdUpdate &&value) |
Update this sketch with a given signed 16-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (uint8_t key, FwdUpdate &&value) |
Update this sketch with a given unsigned 8-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (int8_t key, FwdUpdate &&value) |
Update this sketch with a given signed 8-bit integer. More... | |
template<typename FwdUpdate > | |
void | update (double key, FwdUpdate &&value) |
Update this sketch with a given double-precision floating point value. More... | |
template<typename FwdUpdate > | |
void | update (float key, FwdUpdate &&value) |
Update this sketch with a given floating point value. More... | |
template<typename FwdUpdate > | |
void | update (const void *key, size_t length, FwdUpdate &&value) |
Update this sketch with given data of any type. More... | |
void | trim () |
Remove retained entries in excess of the nominal size k (if any) | |
void | reset () |
Reset the sketch to the initial empty state. | |
compact_tuple_sketch< Summary, Allocator > | compact (bool ordered=true) const |
Converts this sketch to a compact sketch (ordered or unordered). More... | |
template<typename Predicate > | |
compact_tuple_sketch< Summary, Allocator > | filter (const Predicate &predicate) const |
Produces a Compact Tuple sketch from this sketch by applying a given predicate to each entry. More... | |
virtual iterator | begin () |
Iterator over entries in this sketch. More... | |
virtual iterator | end () |
Iterator pointing past the valid range. More... | |
virtual const_iterator | begin () const |
Const iterator over entries in this sketch. More... | |
virtual const_iterator | end () const |
Const iterator pointing past the valid range. More... | |
Public Member Functions inherited from tuple_sketch< Summary, std::allocator< Summary > > | |
double | get_estimate () const |
double | get_lower_bound (uint8_t num_std_devs, uint32_t num_subset_entries) const |
Returns the approximate lower error bound given a number of standard deviations over an arbitrary number of items stored in the sketch. More... | |
double | get_lower_bound (uint8_t num_std_devs) const |
Returns the approximate lower error bound given a number of standard deviations. More... | |
double | get_upper_bound (uint8_t num_std_devs, uint32_t num_subset_entries) const |
Returns the approximate upper error bound given a number of standard deviations over an arbitrary number of items stored in the sketch. More... | |
double | get_upper_bound (uint8_t num_std_devs) const |
Returns the approximate upper error bound given a number of standard deviations. More... | |
bool | is_estimation_mode () const |
double | get_theta () const |
string< std::allocator< Summary > > | to_string (bool print_items=false) const |
Provides a human-readable summary of this sketch as a string. More... | |
Update Tuple sketch.
The purpose of this class is to build a Tuple sketch from input data via the update() methods. There is no constructor. Use builder instead.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Implements tuple_sketch< Summary, std::allocator< Summary > >.
uint8_t get_lg_k |
auto get_rf |
|
inline |
Update this sketch with a given string.
key | string to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given unsigned 64-bit integer.
key | uint64_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given signed 64-bit integer.
key | int64_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given unsigned 32-bit integer.
For compatibility with Java implementation.
key | uint32_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given signed 32-bit integer.
For compatibility with Java implementation.
key | int32_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given unsigned 16-bit integer.
For compatibility with Java implementation.
key | uint16_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given signed 16-bit integer.
For compatibility with Java implementation.
key | int16_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given unsigned 8-bit integer.
For compatibility with Java implementation.
key | uint8_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given signed 8-bit integer.
For compatibility with Java implementation.
key | int8_t to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given double-precision floating point value.
For compatibility with Java implementation.
key | double to update the sketch with |
value | to update the sketch with |
|
inline |
Update this sketch with a given floating point value.
For compatibility with Java implementation.
key | float to update the sketch with |
value | to update the sketch with |
void update | ( | const void * | key, |
size_t | length, | ||
FwdUpdate && | value | ||
) |
Update this sketch with given data of any type.
This is a "universal" update that covers all cases above, but may produce different hashes. Be very careful to hash input values consistently using the same approach both over time and on different platforms and while passing sketches between C++ environment and Java environment. Otherwise two sketches that should represent overlapping sets will be disjoint For instance, for signed 32-bit values call update(int32_t) method above, which does widening conversion to int64_t, if compatibility with Java is expected
key | pointer to the data |
length | of the data in bytes |
value | to update the sketch with |
compact_tuple_sketch< S, A > compact | ( | bool | ordered = true | ) | const |
Converts this sketch to a compact sketch (ordered or unordered).
ordered | optional flag to specify if an ordered sketch should be produced |
compact_tuple_sketch<Summary, Allocator> filter | ( | const Predicate & | predicate | ) | const |
Produces a Compact Tuple sketch from this sketch by applying a given predicate to each entry.
predicate | should return true for the entries to keep |
|
virtual |
Iterator over entries in this sketch.
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Iterator pointing past the valid range.
Not to be incremented or dereferenced.
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Const iterator over entries in this sketch.
Implements tuple_sketch< Summary, std::allocator< Summary > >.
|
virtual |
Const iterator pointing past the valid range.
Not to be incremented or dereferenced.
Implements tuple_sketch< Summary, std::allocator< Summary > >.