aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/histogram/adaptive/histogram.h
diff options
context:
space:
mode:
authorzosimov <zosimov@yandex-team.ru>2022-02-10 16:50:32 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:32 +0300
commita8f009e06d613c9567eb4c0f461dbed5e0d8092b (patch)
treed21fc5cd2e0d5ade9588ebc637729e86b924279b /library/cpp/histogram/adaptive/histogram.h
parent06e925754c8de946ff79d538bde1e6424cbd4cbb (diff)
downloadydb-a8f009e06d613c9567eb4c0f461dbed5e0d8092b.tar.gz
Restoring authorship annotation for <zosimov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/histogram/adaptive/histogram.h')
-rw-r--r--library/cpp/histogram/adaptive/histogram.h84
1 files changed, 42 insertions, 42 deletions
diff --git a/library/cpp/histogram/adaptive/histogram.h b/library/cpp/histogram/adaptive/histogram.h
index 360fd9a693..58a6af4605 100644
--- a/library/cpp/histogram/adaptive/histogram.h
+++ b/library/cpp/histogram/adaptive/histogram.h
@@ -1,54 +1,54 @@
-#pragma once
-
-#include <util/generic/ptr.h>
-#include <util/generic/vector.h>
-
-namespace NKiwiAggr {
+#pragma once
+
+#include <util/generic/ptr.h>
+#include <util/generic/vector.h>
+
+namespace NKiwiAggr {
class THistogram;
class THistoRec;
-
- class IHistogram;
+
+ class IHistogram;
typedef TAtomicSharedPtr<IHistogram> IHistogramPtr;
-
- class IHistogram {
- public:
- // Supposed constructors:
- //
+
+ class IHistogram {
+ public:
+ // Supposed constructors:
+ //
// TSomeHistogram(size_t intervals, ui64 id = 0); // where intervals is some constant that defines histogram accuracy
- // TSomeHistogram(const THistogram& histo); // histo must be acceptable for TSomeHistogram, for example, only with HT_FIXED_BIN_HISTOGRAM for TFixedBinHistogram
- // TSomeHistogram(IHistogram* histo); // any kind of IHistogram
-
+ // TSomeHistogram(const THistogram& histo); // histo must be acceptable for TSomeHistogram, for example, only with HT_FIXED_BIN_HISTOGRAM for TFixedBinHistogram
+ // TSomeHistogram(IHistogram* histo); // any kind of IHistogram
+
virtual ~IHistogram() {
- }
-
- virtual void Clear() = 0;
-
- // zero- or negative-weighted values are skipped
- virtual void Add(double value, double weight) = 0;
- virtual void Add(const THistoRec& histoRec) = 0;
-
- // Merge some other histos into current
+ }
+
+ virtual void Clear() = 0;
+
+ // zero- or negative-weighted values are skipped
+ virtual void Add(double value, double weight) = 0;
+ virtual void Add(const THistoRec& histoRec) = 0;
+
+ // Merge some other histos into current
virtual void Merge(const THistogram& histo, double multiplier) = 0;
virtual void Merge(const TVector<THistogram>& histogramsToMerge) = 0;
virtual void Merge(TVector<IHistogramPtr> histogramsToMerge) = 0;
-
- // factor should be greater then zero
- virtual void Multiply(double factor) = 0;
-
+
+ // factor should be greater then zero
+ virtual void Multiply(double factor) = 0;
+
virtual void FromProto(const THistogram& histo) = 0; // throws exception in case of wrong histogram type of histo
- virtual void ToProto(THistogram& histo) = 0;
-
+ virtual void ToProto(THistogram& histo) = 0;
+
virtual void SetId(ui64 id) = 0;
virtual ui64 GetId() = 0;
- virtual bool Empty() = 0;
- virtual double GetMinValue() = 0;
- virtual double GetMaxValue() = 0;
- virtual double GetSum() = 0;
- virtual double GetSumInRange(double leftBound, double rightBound) = 0;
- virtual double GetSumAboveBound(double bound) = 0;
- virtual double GetSumBelowBound(double bound) = 0;
- virtual double CalcUpperBound(double sum) = 0;
- virtual double CalcLowerBound(double sum) = 0;
+ virtual bool Empty() = 0;
+ virtual double GetMinValue() = 0;
+ virtual double GetMaxValue() = 0;
+ virtual double GetSum() = 0;
+ virtual double GetSumInRange(double leftBound, double rightBound) = 0;
+ virtual double GetSumAboveBound(double bound) = 0;
+ virtual double GetSumBelowBound(double bound) = 0;
+ virtual double CalcUpperBound(double sum) = 0;
+ virtual double CalcLowerBound(double sum) = 0;
virtual double CalcUpperBoundSafe(double sum) = 0;
virtual double CalcLowerBoundSafe(double sum) = 0;
double GetValueAtPercentile(double percentile) {
@@ -61,6 +61,6 @@ namespace NKiwiAggr {
// Histogram implementation is supposed to clear all precomputed values() if Add() is called after PrecomputePartialSums()
virtual void PrecomputePartialSums() {
}
- };
-
+ };
+
}