diff options
author | ksjuchi <ksjuchi@yandex-team.ru> | 2022-02-10 16:50:57 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:57 +0300 |
commit | ca11887f7546c03fa3376cd513cad0be958cfb00 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
parent | 5c1bb165b6316cb97192253f57b1cca84a724e0a (diff) | |
download | ydb-ca11887f7546c03fa3376cd513cad0be958cfb00.tar.gz |
Restoring authorship annotation for <ksjuchi@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/histogram/adaptive/fixed_bin_histogram.cpp | 8 | ||||
-rw-r--r-- | library/cpp/histogram/adaptive/fixed_bin_histogram.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp index 2a8f5e05ae..558aba9e2d 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp @@ -495,14 +495,14 @@ namespace NKiwiAggr { return (BinRange == 0.0) ? BaseIndex : static_cast<i32>(BaseIndex + (value - ReferencePoint) / BinRange); } - double TFixedBinHistogram::CalcDensity(double value) { + double TFixedBinHistogram::CalcDensity(double value) { i32 bin = CalcBin(value); if (bin < 0 || bin >= (i32)Freqs.size() || BinRange == 0.0 || GetSum() == 0) { return 0.0; } - return Freqs[bin] / GetSum() / BinRange; - } - + return Freqs[bin] / GetSum() / BinRange; + } + double TFixedBinHistogram::BinStart(i32 i) { return Max(ReferencePoint + (i - BaseIndex) * BinRange, MinValue); } diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.h b/library/cpp/histogram/adaptive/fixed_bin_histogram.h index daf9725a90..bd380bd94a 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.h +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.h @@ -71,8 +71,8 @@ namespace NKiwiAggr { virtual double CalcUpperBoundSafe(double sum); virtual double CalcLowerBoundSafe(double sum); - double CalcDensity(double value); - + double CalcDensity(double value); + private: double CalcBinRange(double referencePoint, double maxValue); void SetFrame(double minValue, double maxValue, bool clear); |