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

Theta intersection. More...

#include <theta_intersection.hpp>

Public Member Functions

 theta_intersection_alloc (uint64_t seed=DEFAULT_SEED, const Allocator &allocator=Allocator())
 Constructor. More...
 
template<typename FwdSketch >
void update (FwdSketch &&sketch)
 Updates the intersection with a given sketch. More...
 
CompactSketch get_result (bool ordered=true) const
 Produces a copy of the current state of the intersection. More...
 
bool has_result () const
 Returns true if the state of the intersection is defined (not infinite "universe"). More...
 

Detailed Description

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

Theta intersection.

Computes intersection of Theta sketches.

Constructor & Destructor Documentation

◆ theta_intersection_alloc()

theta_intersection_alloc ( uint64_t  seed = DEFAULT_SEED,
const Allocator &  allocator = Allocator() 
)
explicit

Constructor.

Parameters
seedfor the hash function that was used to create the sketch
allocatorto use for allocating and deallocating memory

Member Function Documentation

◆ update()

void update ( FwdSketch &&  sketch)

Updates the intersection with a given sketch.

The intersection can be viewed as starting from the "universe" set, and every update can reduce the current set to leave the overlapping subset only.

Parameters
sketchrepresents input set for the intersection

◆ get_result()

auto get_result ( bool  ordered = true) const

Produces a copy of the current state of the intersection.

If update() was not called, the state is the infinite "universe", which is considered an undefined state, and throws an exception.

Parameters
orderedoptional flag to specify if an ordered sketch should be produced
Returns
the result of the intersection

◆ has_result()

bool has_result

Returns true if the state of the intersection is defined (not infinite "universe").

Returns
true if the state is valid

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