Lens AI Profiler Cpp
kll.h
1 
8 #ifndef KLL_SKETCH_H
9 #define KLL_SKETCH_H
10 
11 #include <iostream>
12 #include <vector>
13 #include <algorithm>
14 
21 class KLLSketch {
22 public:
28  KLLSketch(int maxBins);
29  KLLSketch() {
30  KLLSketch(10);
31  };
32 
40  void update(double value);
41 
50  double getQuantile(double quantile);
51 
52 private:
58  void mergeBins();
59 
60  std::vector<double> bins;
61  int maxBins;
62 };
63 
64 #endif
65 
A sketch data structure for approximate quantile estimation.
Definition: kll.h:21
void update(double value)
Updates the sketch with a new data point.
Definition: kll.cpp:24
double getQuantile(double quantile)
Estimates the quantile of the data stream represented by the sketch.
Definition: kll.cpp:41