aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/histogram/adaptive/block_histogram.cpp
diff options
context:
space:
mode:
authorvictor-k <victor-k@yandex-team.ru>2022-02-10 16:50:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:38 +0300
commit17cbaf6d2b820cd304e92faa6ac2e6426605cae8 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/histogram/adaptive/block_histogram.cpp
parentf632afcab870d2327aaa8388ceeb7aeb2bb6a1c1 (diff)
downloadydb-17cbaf6d2b820cd304e92faa6ac2e6426605cae8.tar.gz
Restoring authorship annotation for <victor-k@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/histogram/adaptive/block_histogram.cpp')
-rw-r--r--library/cpp/histogram/adaptive/block_histogram.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/library/cpp/histogram/adaptive/block_histogram.cpp b/library/cpp/histogram/adaptive/block_histogram.cpp
index 779d90496c..6586d13ff6 100644
--- a/library/cpp/histogram/adaptive/block_histogram.cpp
+++ b/library/cpp/histogram/adaptive/block_histogram.cpp
@@ -82,7 +82,7 @@ namespace NKiwiAggr {
///////////////////
TBlockHistogram::TBlockHistogram(EHistogramType type, TQualityFunction calcQuality,
- size_t intervals, ui64 id, size_t shrinkSize)
+ size_t intervals, ui64 id, size_t shrinkSize)
: Type(type)
, CalcQuality(calcQuality)
, Intervals(intervals)
@@ -112,7 +112,7 @@ namespace NKiwiAggr {
void TBlockHistogram::Add(double value, double weight) {
if (!IsValidFloat(value) || !IsValidFloat(weight)) {
- ythrow yexception() << Sprintf("Histogram id %lu: bad value %f weight %f", Id, value, weight);
+ ythrow yexception() << Sprintf("Histogram id %lu: bad value %f weight %f", Id, value, weight);
}
if (weight <= 0.0) {
@@ -138,7 +138,7 @@ namespace NKiwiAggr {
void TBlockHistogram::Merge(const THistogram& histo, double multiplier) {
if (!IsValidFloat(histo.GetMinValue()) || !IsValidFloat(histo.GetMaxValue())) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad histo with minvalue %f maxvalue %f\n", Id, histo.GetMinValue(), histo.GetMaxValue());
+ fprintf(stderr, "Merging in histogram id %lu: skip bad histo with minvalue %f maxvalue %f\n", Id, histo.GetMinValue(), histo.GetMaxValue());
return;
}
if (histo.FreqSize() == 0) {
@@ -154,7 +154,7 @@ namespace NKiwiAggr {
double value = histo.GetPosition(j);
double weight = histo.GetFreq(j);
if (!IsValidFloat(value) || !IsValidFloat(weight)) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
+ fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
continue;
}
Add(value, weight * multiplier);
@@ -167,7 +167,7 @@ namespace NKiwiAggr {
for (size_t j = 0; j < histo.FreqSize(); ++j) {
double weight = histo.GetFreq(j);
if (!IsValidFloat(pos) || !IsValidFloat(weight)) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, pos, weight);
+ fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, pos, weight);
pos += histo.GetBinRange();
continue;
}
@@ -229,7 +229,7 @@ namespace NKiwiAggr {
double value = histo.GetPosition(i);
double weight = histo.GetFreq(i);
if (!IsValidFloat(value) || !IsValidFloat(weight)) {
- fprintf(stderr, "FromProto in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
+ fprintf(stderr, "FromProto in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
continue;
}
Bins[i].first = value;
@@ -238,7 +238,7 @@ namespace NKiwiAggr {
}
if (!IsValidFloat(histo.GetMinValue()) || !IsValidFloat(histo.GetMaxValue())) {
- ythrow yexception() << Sprintf("FromProto in histogram id %lu: skip bad histo with minvalue %f maxvalue %f", Id, histo.GetMinValue(), histo.GetMaxValue());
+ ythrow yexception() << Sprintf("FromProto in histogram id %lu: skip bad histo with minvalue %f maxvalue %f", Id, histo.GetMinValue(), histo.GetMaxValue());
}
MinValue = histo.GetMinValue();
MaxValue = histo.GetMaxValue();
@@ -261,11 +261,11 @@ namespace NKiwiAggr {
}
}
- void TBlockHistogram::SetId(ui64 id) {
+ void TBlockHistogram::SetId(ui64 id) {
Id = id;
}
- ui64 TBlockHistogram::GetId() {
+ ui64 TBlockHistogram::GetId() {
return Id;
}
@@ -445,23 +445,23 @@ namespace NKiwiAggr {
return 0;
}
- double TBlockHistogram::CalcUpperBoundSafe(double sum) {
+ double TBlockHistogram::CalcUpperBoundSafe(double sum) {
Y_UNUSED(sum);
- ythrow yexception() << "Method is not implemented for TBlockHistogram";
- return 0;
- }
+ ythrow yexception() << "Method is not implemented for TBlockHistogram";
+ return 0;
+ }
- double TBlockHistogram::CalcLowerBoundSafe(double sum) {
+ double TBlockHistogram::CalcLowerBoundSafe(double sum) {
Y_UNUSED(sum);
- ythrow yexception() << "Method is not implemented for TBlockHistogram";
- return 0;
- }
-
+ ythrow yexception() << "Method is not implemented for TBlockHistogram";
+ return 0;
+ }
+
/////////////////////////
// TBlockWeightHistogram
/////////////////////////
- TBlockWeightHistogram::TBlockWeightHistogram(size_t intervals, ui64 id, size_t shrinkSize)
+ TBlockWeightHistogram::TBlockWeightHistogram(size_t intervals, ui64 id, size_t shrinkSize)
: TBlockHistogram(HT_ADAPTIVE_WEIGHT_HISTOGRAM, CalcWeightQuality, intervals, id, shrinkSize)
{
}
@@ -494,7 +494,7 @@ namespace NKiwiAggr {
// TBlockWardHistogram
///////////////////////
- TBlockWardHistogram::TBlockWardHistogram(size_t intervals, ui64 id, size_t shrinkSize)
+ TBlockWardHistogram::TBlockWardHistogram(size_t intervals, ui64 id, size_t shrinkSize)
: TBlockHistogram(HT_ADAPTIVE_WARD_HISTOGRAM, CalcWardQuality, intervals, id, shrinkSize)
{
}