Medial Code Documentation
|
template for all quantile sketch algorithm that uses merge/prune scheme More...
#include <quantile.h>
Data Structures | |
struct | SummaryContainer |
same as summary, but use STL to backup the space More... | |
Public Types | |
using | Summary = TSummary |
type of summary type | |
using | Entry = typename Summary::Entry |
the entry type | |
Public Member Functions | |
void | Init (size_t maxn, double eps) |
initialize the quantile sketch, given the performance specification | |
void | Push (DType x, RType w=1) |
add an element to a sketch | |
void | PushSummary (const Summary &summary) |
void | PushTemp () |
push up temp | |
void | GetSummary (SummaryContainer *out) |
get the summary after finalize | |
void | CheckValid (RType eps) const |
void | InitLevel (size_t nlevel) |
Static Public Member Functions | |
static void | LimitSizeLevel (size_t maxn, double eps, size_t *out_nlevel, size_t *out_limit_size) |
Data Fields | |
Summary::Queue | inqueue |
size_t | nlevel |
size_t | limit_size |
std::vector< Summary > | level |
std::vector< Entry > | data |
SummaryContainer | temp |
Static Public Attributes | |
static float constexpr | kFactor = 8.0 |
template for all quantile sketch algorithm that uses merge/prune scheme
DType | type of data content |
RType | type of rank |
TSummary | actual summary data structure it uses |
|
inline |
initialize the quantile sketch, given the performance specification
maxn | maximum number of data points can be feed into sketch |
eps | accuracy level of summary |
|
inline |
add an element to a sketch
x | The element added to the sketch |
w | The weight of the element. |