datasketches-cpp
Public Member Functions | Static Public Member Functions | List of all members
wrapped_compact_theta_sketch_alloc< Allocator > Class Template Reference

Wrapped Compact Theta sketch. More...

#include <theta_sketch.hpp>

Inheritance diagram for wrapped_compact_theta_sketch_alloc< Allocator >:
base_theta_sketch_alloc< std::allocator< uint64_t > >

Public Member Functions

Allocator get_allocator () const
 
bool is_empty () const
 
bool is_ordered () const
 
uint64_t get_theta64 () const
 
uint32_t get_num_retained () const
 
uint16_t get_seed_hash () const
 
const_iterator begin () const
 Const iterator over hash values in this sketch. More...
 
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...
 

Static Public Member Functions

static const wrapped_compact_theta_sketch_alloc wrap (const void *bytes, size_t size, uint64_t seed=DEFAULT_SEED, bool dump_on_error=false)
 This method wraps a serialized compact sketch as an array of bytes. More...
 

Detailed Description

template<typename Allocator = std::allocator<uint64_t>>
class datasketches::wrapped_compact_theta_sketch_alloc< Allocator >

Wrapped Compact Theta sketch.

This is to wrap a buffer containing a serialized compact sketch and use it in a set operation avoiding some cost of deserialization. It does not take the ownership of the buffer.

Member Function Documentation

◆ get_allocator()

A get_allocator
virtual

◆ is_empty()

bool is_empty
virtual
Returns
true if this sketch represents an empty set (not the same as no retained entries!)

Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.

◆ is_ordered()

bool is_ordered
virtual
Returns
true if retained entries are ordered

Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.

◆ get_theta64()

uint64_t get_theta64
virtual
Returns
theta as a positive integer between 0 and LLONG_MAX

Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.

◆ get_num_retained()

uint32_t get_num_retained
virtual
Returns
the number of retained entries in the sketch

Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.

◆ get_seed_hash()

uint16_t get_seed_hash
virtual
Returns
hash of the seed that was used to hash the input

Implements base_theta_sketch_alloc< std::allocator< uint64_t > >.

◆ begin()

auto begin

Const iterator over hash values in this sketch.

Returns
begin iterator

◆ end()

auto end

Const iterator pointing past the valid range.

Not to be incremented or dereferenced.

Returns
end iterator

◆ wrap()

const wrapped_compact_theta_sketch_alloc< A > wrap ( const void *  bytes,
size_t  size,
uint64_t  seed = DEFAULT_SEED,
bool  dump_on_error = false 
)
static

This method wraps a serialized compact sketch as an array of bytes.

Parameters
bytespointer to the array of bytes
sizethe size of the array
seedthe seed for the hash function that was used to create the sketch
dump_on_errorif true prints hex dump of the input
Returns
an instance of the sketch

The documentation for this class was generated from the following files: