Approximate N-tiles for data items from an ordered domain. More...
#include <szaru.h>
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 QuantileEstimator * | Create (uint32_t numQuantiles) |
Create a QuantileEstimator object. |
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.
virtual void SZaru::QuantileEstimator< Key >::AddElem | ( | const Key & | elm | ) | [pure virtual] |
Add a new element to this entry.
elm | element to add |
static QuantileEstimator* SZaru::QuantileEstimator< Key >::Create | ( | uint32_t | numQuantiles | ) | [static] |
Create a QuantileEstimator object.
numQuantiles | number of tiles to be estimate. |
virtual void SZaru::QuantileEstimator< Key >::Estimate | ( | std::vector< Key > & | output | ) | [pure virtual] |
Estimate the quantile entries.
output | estimated quantile. |
virtual uint64_t SZaru::QuantileEstimator< Key >::TotElems | ( | ) | const [pure virtual] |
Get the number of elements added to this entry in the table.