SZaru::QuantileEstimator< Key > Class Template Reference

Approximate N-tiles for data items from an ordered domain. More...

#include <szaru.h>

List of all members.

Public Member Functions

virtual void AddElem (const Key &elm)=0
 Add a new element to this entry.
virtual void Estimate (std::vector< Key > &output)=0
 Estimate the quantile entries.
virtual uint64_t TotElems () const =0
 Get the number of elements added to this entry in the table.
template<>
QuantileEstimator< int32_t > * Create (uint32_t numQuantiles)
template<>
QuantileEstimator< int64_t > * Create (uint32_t numQuantiles)
template<>
QuantileEstimator< double > * Create (uint32_t numQuantiles)

Static Public Member Functions

static QuantileEstimatorCreate (uint32_t numQuantiles)
 Create a QuantileEstimator object.

Detailed Description

template<typename Key>
class SZaru::QuantileEstimator< Key >

Approximate N-tiles for data items from an ordered domain.

Note: Currently only 3 types (int32_t, int64_t, double) can be set to Key template.

Approximate N-tiles for data items from an ordered domain based on the following paper: Munro & Paterson, "Selection and Sorting with Limited Storage", Theoretical Computer Science, Vol 12, p 315-323, 1980.


Member Function Documentation

template<typename Key>
virtual void SZaru::QuantileEstimator< Key >::AddElem ( const Key &  elm  )  [pure virtual]

Add a new element to this entry.

Parameters:
elm element to add
template<typename Key>
static QuantileEstimator* SZaru::QuantileEstimator< Key >::Create ( uint32_t  numQuantiles  )  [static]

Create a QuantileEstimator object.

Parameters:
numQuantiles number of tiles to be estimate.
template<typename Key>
virtual void SZaru::QuantileEstimator< Key >::Estimate ( std::vector< Key > &  output  )  [pure virtual]

Estimate the quantile entries.

Parameters:
output estimated quantile.
template<typename Key>
virtual uint64_t SZaru::QuantileEstimator< Key >::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