SZaru::UniqueEstimator Class Reference

Statistical estimators for the total number of unique data items. More...

#include <szaru.h>

List of all members.

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 UniqueEstimatorCreate (int nElemes)
 Create a UniqueEstimator object.

Detailed Description

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


Member Function Documentation

virtual void SZaru::UniqueEstimator::AddElem ( const std::string &  elm  )  [pure virtual]

Add a new element to this entry.

Parameters:
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.

Parameters:
data element data
size element size
static UniqueEstimator* SZaru::UniqueEstimator::Create ( int  nElemes  )  [static]

Create a UniqueEstimator object.

Parameters:
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.

Returns:
the estimated 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.

Returns:
the number of added elements

The documentation for this class was generated from the following file:
 All Classes Functions
Generated on Sat Nov 13 18:14:59 2010 for SZaru by  doxygen 1.6.3