krowkee::sketch module reference.
krowkee::sketch::Sketch is the basic interface for specifiying sketch data structures in krowkee. However, the behavior of krowkee::sketch::Sketch is heavily modfied by its template arguments. The ContainerType template determines the underlying memory managment behavior of the register set. krowkee::sketch::Dense yields the simplest behavior, and stores the registers as an std::vector. krowkee::sketch::Sparse is more sophisticated, and stores the registers as a krowkee::container::compacting_map under the hood. krowkee::sketch::Promotable marries the two, and allows a sketch to begin life as with a Sparse container that is promoted to Dense if it becomes sufficiently full.
Register Container Types:
A sketch is also defined by the transform that it supports. This transform defines the way in which updates affect the set of registers, and is fundamental to the statistical guarantees of the associated sketch.
Transform Types:
-
template<typename SketchFunc, typename ContainerType, template<typename> class PtrType>
class Sketch General Sketch Chassis.
Implements the container handling infrastructure of a linear sketch defined by a given sketch functor projecting into a fixed-size set of registers supporting an (element-wise) merge operator. The registers might be Dense, Sparse, or variable, depending on the templated ContainerType.
- Template Parameters:
SketchFunc – A sketch functor such as
krowkee::transform::CountSketchFunctorwhose first template parameter is set byRegType.ContainerType – A container class such as
krowkee::sketch::Dense.PtrType – The type of shared pointer used to wrap the sketch functor. Should be
std::shared_ptrin shared memory andygm::ygm_ptrin distributed memory.Args – Additional template parameters for
SketchFunc, such as a hash functor.