aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
diff options
context:
space:
mode:
authorreverie <reverie@yandex-team.ru>2022-02-10 16:50:56 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:56 +0300
commita53448e7a898701b4411c68f0d438e703872f1a1 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
parent715969815532bc3ecdd5169efec8fc265e700a8b (diff)
downloadydb-a53448e7a898701b4411c68f0d438e703872f1a1.tar.gz
Restoring authorship annotation for <reverie@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/histogram/adaptive/fixed_bin_histogram.cpp')
-rw-r--r--library/cpp/histogram/adaptive/fixed_bin_histogram.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
index d7760e60b5..558aba9e2d 100644
--- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
+++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp
@@ -1,14 +1,14 @@
-#include "fixed_bin_histogram.h"
+#include "fixed_bin_histogram.h"
#include "auto_histogram.h"
-
+
#include <library/cpp/histogram/adaptive/protos/histo.pb.h>
-
+
#include <util/generic/algorithm.h>
#include <util/generic/yexception.h>
#include <util/generic/ymath.h>
#include <util/string/printf.h>
-namespace NKiwiAggr {
+namespace NKiwiAggr {
TFixedBinHistogram::TFixedBinHistogram(size_t intervals, ui64 id, size_t trainingSetSize)
: TrainingSetSize(trainingSetSize)
, IsInitialized(false)
@@ -37,7 +37,7 @@ namespace NKiwiAggr {
{
FromProto(histo);
}
-
+
TFixedBinHistogram::TFixedBinHistogram(IHistogram* histo, size_t defaultIntervals, ui64 defaultId, size_t trainingSetSize)
: TrainingSetSize(trainingSetSize)
, IsInitialized(false)
@@ -203,7 +203,7 @@ namespace NKiwiAggr {
}
}
}
- }
+ }
void TFixedBinHistogram::Multiply(double factor) {
if (!IsValidFloat(factor) || factor <= 0) {
@@ -252,8 +252,8 @@ namespace NKiwiAggr {
}
Sum += Freqs[i];
}
- }
-
+ }
+
void TFixedBinHistogram::ToProto(THistogram& histo) {
histo.Clear();
if (!IsInitialized) {
@@ -286,9 +286,9 @@ namespace NKiwiAggr {
bool TFixedBinHistogram::Empty() {
if (!IsInitialized) {
Initialize();
- }
+ }
return IsEmpty;
- }
+ }
double TFixedBinHistogram::GetMinValue() {
if (!IsInitialized) {
@@ -296,18 +296,18 @@ namespace NKiwiAggr {
}
return MinValue;
}
-
+
double TFixedBinHistogram::GetMaxValue() {
if (!IsInitialized) {
Initialize();
}
return MaxValue;
- }
+ }
double TFixedBinHistogram::GetSum() {
return Sum;
- }
-
+ }
+
double TFixedBinHistogram::GetSumInRange(double leftBound, double rightBound) {
if (!IsInitialized) {
Initialize();