Statistical estimators for the total number of unique data items. More...
#include <szaru.h>
Public Member Functions | |
virtual void | AddElem (const std::string &elm)=0 |
Add a new element to this entry. | |
virtual void | AddElemInCIF (const char *data, size_t size)=0 |
Add a new element to this entry in C sylte interface. | |
virtual int64_t | Estimate () const =0 |
Estimate the number of unique entries. | |
virtual uint64_t | TotElems () const =0 |
Get the number of elements added to this entry in the table. | |
Static Public Member Functions | |
static UniqueEstimator * | Create (int nElemes) |
Create a UniqueEstimator object. |
Statistical estimators for the total number of unique data items.
Structure for calculating the number of unique elements.
The technique used is:
unique = nElemes < maxelems ? nElems : (maxelems << bits-in-hash) / biggest-small-elem
virtual void SZaru::UniqueEstimator::AddElem | ( | const std::string & | elm | ) | [pure virtual] |
Add a new element to this entry.
elm | element to add |
virtual void SZaru::UniqueEstimator::AddElemInCIF | ( | const char * | data, | |
size_t | size | |||
) | [pure virtual] |
Add a new element to this entry in C sylte interface.
data | element data | |
size | element size |
static UniqueEstimator* SZaru::UniqueEstimator::Create | ( | int | nElemes | ) | [static] |
Create a UniqueEstimator object.
nElemes | tuning parameter. If nElemes is bigger, the estimation becomes more accurate but consuming more memory. |
virtual int64_t SZaru::UniqueEstimator::Estimate | ( | ) | const [pure virtual] |
Estimate the number of unique entries.
virtual uint64_t SZaru::UniqueEstimator::TotElems | ( | ) | const [pure virtual] |
Get the number of elements added to this entry in the table.