Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSaydakov committed May 10, 2024
1 parent 6c807c6 commit cb1cdc4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tuple/include/tuple_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,29 @@

namespace datasketches {

/**
* Filter entries in a Tuple sketch according to a predicate.
*/
template<typename Summary, typename Allocator = std::allocator<Summary>>
class tuple_filter {
public:
using Entry = std::pair<uint64_t, Summary>;
using CompactSketch = compact_tuple_sketch<Summary, Allocator>;
using AllocEntry = typename std::allocator_traits<Allocator>::template rebind_alloc<Entry>;

/**
* Constructor
* @param allocator to use for allocating and deallocating memory
*/
explicit tuple_filter(const Allocator& allocator = Allocator());

/**
* Produces a Compact Tuple sketch from a given sketch (Update or Compact)
* by applying a given predicate to each entry.
* @param sketch input sketch
* @param predicate should return true for the entries to keep
* @return compact sketch with the entries retained according to the predicate
*/
template<typename Sketch, typename Predicate>
CompactSketch compute(const Sketch& sketch, const Predicate& predicate) const;

Expand Down

0 comments on commit cb1cdc4

Please sign in to comment.