datasketches-cpp
|
Update Theta sketch. More...
#include <theta_sketch.hpp>
Classes | |
class | builder |
Update Theta sketch builder. More... | |
Public Member Functions | |
update_theta_sketch_alloc (const update_theta_sketch_alloc &other)=default | |
Copy constructor. More... | |
update_theta_sketch_alloc (update_theta_sketch_alloc &&other) noexcept=default | |
Move constructor. More... | |
update_theta_sketch_alloc & | operator= (const update_theta_sketch_alloc &other)=default |
Copy assignment. More... | |
update_theta_sketch_alloc & | operator= (update_theta_sketch_alloc &&other)=default |
Move assignment. More... | |
virtual Allocator | get_allocator () const |
virtual bool | is_empty () const |
virtual bool | is_ordered () const |
virtual uint16_t | get_seed_hash () const |
virtual uint64_t | get_theta64 () const |
virtual uint32_t | get_num_retained () const |
uint8_t | get_lg_k () const |
resize_factor | get_rf () const |
void | update (const std::string &value) |
Update this sketch with a given string. More... | |
void | update (uint64_t value) |
Update this sketch with a given unsigned 64-bit integer. More... | |
void | update (int64_t value) |
Update this sketch with a given signed 64-bit integer. More... | |
void | update (uint32_t value) |
Update this sketch with a given unsigned 32-bit integer. More... | |
void | update (int32_t value) |
Update this sketch with a given signed 32-bit integer. More... | |
void | update (uint16_t value) |
Update this sketch with a given unsigned 16-bit integer. More... | |
void | update (int16_t value) |
Update this sketch with a given signed 16-bit integer. More... | |
void | update (uint8_t value) |
Update this sketch with a given unsigned 8-bit integer. More... | |
void | update (int8_t value) |
Update this sketch with a given signed 8-bit integer. More... | |
void | update (double value) |
Update this sketch with a given double-precision floating point value. More... | |
void | update (float value) |
Update this sketch with a given floating point value. More... | |
void | update (const void *data, size_t length) |
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_theta_sketch_alloc< Allocator > | compact (bool ordered=true) const |
Converts this sketch to a compact sketch (ordered or unordered). More... | |
virtual iterator | begin () |
Iterator over hash values in this sketch. More... | |
virtual iterator | end () |
Iterator pointing past the valid range. More... | |
virtual const_iterator | begin () const |
Const iterator over hash values in this sketch. More... | |
virtual const_iterator | end () const |
Const iterator pointing past the valid range. More... | |
Public Member Functions inherited from base_theta_sketch_alloc< std::allocator< uint64_t > > | |
double | get_estimate () const |
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) const |
Returns the approximate upper error bound given a number of standard deviations. More... | |
bool | is_estimation_mode () const |
double | get_theta () const |
virtual string< std::allocator< uint64_t > > | to_string (bool print_items=false) const |
Provides a human-readable summary of this sketch as a string. More... | |
Update Theta sketch.
The purpose of this class is to build a Theta sketch from input data via the update() methods. There is no constructor. Use builder instead.
|
default |
Copy constructor.
other | sketch to be copied |
|
defaultnoexcept |
Move constructor.
other | sketch to be moved |
|
default |
Copy assignment.
other | sketch to be copied |
|
default |
Move assignment.
other | sketch to be moved |
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.
uint8_t get_lg_k |
auto get_rf |
void update | ( | const std::string & | value | ) |
Update this sketch with a given string.
value | string to update the sketch with |
void update | ( | uint64_t | value | ) |
Update this sketch with a given unsigned 64-bit integer.
value | uint64_t to update the sketch with |
void update | ( | int64_t | value | ) |
Update this sketch with a given signed 64-bit integer.
value | int64_t to update the sketch with |
void update | ( | uint32_t | value | ) |
Update this sketch with a given unsigned 32-bit integer.
For compatibility with Java implementation.
value | uint32_t to update the sketch with |
void update | ( | int32_t | value | ) |
Update this sketch with a given signed 32-bit integer.
For compatibility with Java implementation.
value | int32_t to update the sketch with |
void update | ( | uint16_t | value | ) |
Update this sketch with a given unsigned 16-bit integer.
For compatibility with Java implementation.
value | uint16_t to update the sketch with |
void update | ( | int16_t | value | ) |
Update this sketch with a given signed 16-bit integer.
For compatibility with Java implementation.
value | int16_t to update the sketch with |
void update | ( | uint8_t | value | ) |
Update this sketch with a given unsigned 8-bit integer.
For compatibility with Java implementation.
value | uint8_t to update the sketch with |
void update | ( | int8_t | value | ) |
Update this sketch with a given signed 8-bit integer.
For compatibility with Java implementation.
value | int8_t to update the sketch with |
void update | ( | double | value | ) |
Update this sketch with a given double-precision floating point value.
For compatibility with Java implementation.
value | double to update the sketch with |
void update | ( | float | value | ) |
Update this sketch with a given floating point value.
For compatibility with Java implementation.
value | float to update the sketch with |
void update | ( | const void * | data, |
size_t | length | ||
) |
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
data | pointer to the data |
length | of the data in bytes |
compact_theta_sketch_alloc< 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 |
|
virtual |
Iterator over hash values in this sketch.
Implements theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Iterator pointing past the valid range.
Not to be incremented or dereferenced.
Implements theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Const iterator over hash values in this sketch.
Implements theta_sketch_alloc< std::allocator< uint64_t > >.
|
virtual |
Const iterator pointing past the valid range.
Not to be incremented or dereferenced.
Implements theta_sketch_alloc< std::allocator< uint64_t > >.