10 #ifndef sa_cm_sketch_h_ 11 #define sa_cm_sketch_h_ struct sa_cm_sketch sa_cm_sketch
void sa_init_cms(sa_cm_sketch *cms)
Zero out the data structure.
void sa_destroy_cms(sa_cm_sketch *cms)
Free the associated memory.
int sa_deserialize_cms(sa_cm_sketch *cms, const char *buf, size_t len)
Restore the internal state from the serialized output.
sa_cm_sketch * sa_create_cms(double epsilon, double delta)
Allocate and initialize the data structure.
uint32_t sa_update_cms(sa_cm_sketch *cms, void *item, size_t len, int n)
Increment/Decrement the Count-min sketch with the specified item and value.
uint64_t sa_unique_count_cms(sa_cm_sketch *cms)
Return the total number of unique items added to the sketch.
uint64_t sa_item_count_cms(sa_cm_sketch *cms)
Return the total number of items added to the sketch.
char * sa_serialize_cms(sa_cm_sketch *cms, size_t *len)
Serialize the internal state to a buffer.
uint32_t sa_point_query_cms(sa_cm_sketch *cms, void *item, size_t len)
Point query the frequency count of item.