diff options
author | ksjuchi <[email protected]> | 2022-02-10 16:50:57 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:57 +0300 |
commit | 5c1bb165b6316cb97192253f57b1cca84a724e0a (patch) | |
tree | 8651b345477e0f3c67eb3a76ccbadbf65454fd8f /library/cpp/histogram/adaptive/fixed_bin_histogram.cpp | |
parent | 9cc851b34f89d2b8ba19d91e816bddf9c17a8f2c (diff) |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/histogram/adaptive/fixed_bin_histogram.cpp')
-rw-r--r-- | library/cpp/histogram/adaptive/fixed_bin_histogram.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp index 558aba9e2d1..2a8f5e05ae9 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); } |