OmniSketch  0.1
Oh my sketch!
OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t > Class Template Reference

Count Min Sketch with CH. More...

#include <CHCMSketch.h>

Inheritance diagram for OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >:

Public Member Functions

 CHCMSketch (int32_t depth, int32_t width, double cnt_no_ratio, const std::vector< size_t > &width_cnt, const std::vector< size_t > &no_hash)
 Construct by specifying depth, width and ch parameters. More...
 
 ~CHCMSketch ()
 Release the pointer. More...
 
void update (const FlowKey< key_len > &flowkey, T val) override
 Update a flowkey with certain value. More...
 
query (const FlowKey< key_len > &flowkey) const override
 Query a flowkey. More...
 
size_t size () const override
 Get the size of the sketch. More...
 
void clear ()
 Reset the sketch. More...
 
- Public Member Functions inherited from OmniSketch::Sketch::SketchBase< key_len, T >
virtual void insert (const FlowKey< key_len > &flowkey)
 Insert a flowkey without value. More...
 
virtual bool lookup (const FlowKey< key_len > &flowkey) const
 Look up a flowkey in the sketch. More...
 
virtual Data::Estimation< key_len, T > getHeavyHitter (double threshold) const
 Get all the heavy hitters. More...
 
virtual Data::Estimation< key_len, T > getHeavyChanger (std::unique_ptr< SketchBase< key_len, T >> &ptr_sketch, double threshold) const
 Get all the heavy changers. More...
 
virtual Data::Estimation< key_len, T > decode ()
 Decode all flowkeys along with their values. More...
 

Detailed Description

template<int32_t key_len, int32_t no_layer, typename T, typename hash_t = Hash::AwareHash>
class OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >

Count Min Sketch with CH.

Template Parameters
key_lenlength of flowkey
no_layerlayer of CH
Ttype of the counter
hash_thashing class

Constructor & Destructor Documentation

◆ CHCMSketch()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::CHCMSketch ( int32_t  depth,
int32_t  width,
double  cnt_no_ratio,
const std::vector< size_t > &  width_cnt,
const std::vector< size_t > &  no_hash 
)

Construct by specifying depth, width and ch parameters.

Parameters
depthdepth of CM
widthwidth of CM
cnt_no_widthratio of the number of counters in two adjacent layers (should be in (0, 1))
width_cntWidth of counters on each layer
no_hash#hash between adjacent layers

◆ ~CHCMSketch()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::~CHCMSketch

Release the pointer.

Member Function Documentation

◆ clear()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
void OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::clear

Reset the sketch.

◆ query()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
T OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::query ( const FlowKey< key_len > &  flowkey) const
overridevirtual

Query a flowkey.

Reimplemented from OmniSketch::Sketch::SketchBase< key_len, T >.

◆ size()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
size_t OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::size
overridevirtual

Get the size of the sketch.

Reimplemented from OmniSketch::Sketch::SketchBase< key_len, T >.

◆ update()

template<int32_t key_len, int32_t no_layer, typename T , typename hash_t >
void OmniSketch::Sketch::CHCMSketch< key_len, no_layer, T, hash_t >::update ( const FlowKey< key_len > &  flowkey,
val 
)
overridevirtual

Update a flowkey with certain value.

Reimplemented from OmniSketch::Sketch::SketchBase< key_len, T >.