diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/histogram/adaptive/fixed_bin_histogram.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. 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 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp index 558aba9e2d..b92da24809 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp @@ -156,7 +156,7 @@ namespace NKiwiAggr { fixedBinHisto->Initialize(); histogramsToMergeRepacked.push_back(histogramsToMerge[i]); } else { - histogramsToMergeRepacked.push_back(IHistogramPtr(new TFixedBinHistogram(histogramsToMerge[i].Get(), Intervals, Id, TrainingSetSize))); // Convert histograms that are not of TFixedBinHistogram type + histogramsToMergeRepacked.push_back(IHistogramPtr(new TFixedBinHistogram(histogramsToMerge[i].Get(), Intervals, Id, TrainingSetSize))); // Convert histograms that are not of TFixedBinHistogram type } histograms.push_back(dynamic_cast<TFixedBinHistogram*>(histogramsToMergeRepacked.back().Get())); } @@ -213,7 +213,7 @@ namespace NKiwiAggr { Initialize(); } Sum *= factor; - for (i32 i = FirstUsedBin; i <= LastUsedBin; ++i) { + for (i32 i = FirstUsedBin; i <= LastUsedBin; ++i) { Freqs[i] *= factor; } } @@ -325,7 +325,7 @@ namespace NKiwiAggr { if (IsEmpty) { return 0.0; } - if (BinRange == 0.0) { // special case - all values added to histogram are the same + if (BinRange == 0.0) { // special case - all values added to histogram are the same return (bound <= ReferencePoint) ? Sum : 0.0; } i32 bin = CalcBin(bound); @@ -337,7 +337,7 @@ namespace NKiwiAggr { } double binStart = BinStart(bin); double binEnd = BinEnd(bin); - double result = (bound < binStart) ? Freqs[bin] : Freqs[bin] * (binEnd - bound) / (binEnd - binStart); + double result = (bound < binStart) ? Freqs[bin] : Freqs[bin] * (binEnd - bound) / (binEnd - binStart); for (i32 i = bin + 1; i <= LastUsedBin; ++i) { result += Freqs[i]; } @@ -351,7 +351,7 @@ namespace NKiwiAggr { if (IsEmpty) { return 0.0; } - if (BinRange == 0.0) { // special case - all values added to histogram are the same + if (BinRange == 0.0) { // special case - all values added to histogram are the same return (bound > ReferencePoint) ? Sum : 0.0; } i32 bin = CalcBin(bound); @@ -363,7 +363,7 @@ namespace NKiwiAggr { } double binStart = BinStart(bin); double binEnd = BinEnd(bin); - double result = (bound > binEnd) ? Freqs[bin] : Freqs[bin] * (bound - binStart) / (binEnd - binStart); + double result = (bound > binEnd) ? Freqs[bin] : Freqs[bin] * (bound - binStart) / (binEnd - binStart); for (i32 i = bin - 1; i >= FirstUsedBin; --i) { result += Freqs[i]; } @@ -516,7 +516,7 @@ namespace NKiwiAggr { memset(&(ReserveFreqs[0]), 0, ReserveFreqs.size() * sizeof(double)); double newBinRange = CalcBinRange(newReferencePoint, newMaxValue); - for (i32 i = FirstUsedBin; i <= LastUsedBin; ++i) { + for (i32 i = FirstUsedBin; i <= LastUsedBin; ++i) { double binStart = BinStart(i); double binEnd = BinEnd(i); double freq = Freqs[i]; @@ -535,4 +535,4 @@ namespace NKiwiAggr { SetFrame(newReferencePoint, newMaxValue, false); } -} +} |