summaryrefslogtreecommitdiffstats
path: root/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
diff options
context:
space:
mode:
authorksjuchi <[email protected]>2022-02-10 16:50:57 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:50:57 +0300
commit5c1bb165b6316cb97192253f57b1cca84a724e0a (patch)
tree8651b345477e0f3c67eb3a76ccbadbf65454fd8f /library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
parent9cc851b34f89d2b8ba19d91e816bddf9c17a8f2c (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.cpp8
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);
}