diff options
author | Ivan Blinkov <ivan@blinkov.ru> | 2022-02-10 16:47:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:10 +0300 |
commit | 1aeb9a455974457866f78722ad98114bafc84e8a (patch) | |
tree | e4340eaf1668684d83a0a58c36947c5def5350ad /library/cpp/hyperloglog | |
parent | bd5ef432f5cfb1e18851381329d94665a4c22470 (diff) | |
download | ydb-1aeb9a455974457866f78722ad98114bafc84e8a.tar.gz |
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/hyperloglog')
-rw-r--r-- | library/cpp/hyperloglog/README.md | 6 | ||||
-rw-r--r-- | library/cpp/hyperloglog/hyperloglog.cpp | 14 | ||||
-rw-r--r-- | library/cpp/hyperloglog/hyperloglog_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/hyperloglog/ut/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/hyperloglog/ya.make | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/hyperloglog/README.md b/library/cpp/hyperloglog/README.md index 4f29676d61..76f3cf5cb5 100644 --- a/library/cpp/hyperloglog/README.md +++ b/library/cpp/hyperloglog/README.md @@ -1,3 +1,3 @@ -Library for set cardinality estimation. - -See https://static.googleusercontent.com/media/research.google.com/ru//pubs/archive/40671.pdf +Library for set cardinality estimation. + +See https://static.googleusercontent.com/media/research.google.com/ru//pubs/archive/40671.pdf diff --git a/library/cpp/hyperloglog/hyperloglog.cpp b/library/cpp/hyperloglog/hyperloglog.cpp index ec8352abe1..35cae80268 100644 --- a/library/cpp/hyperloglog/hyperloglog.cpp +++ b/library/cpp/hyperloglog/hyperloglog.cpp @@ -1,4 +1,4 @@ -#include "hyperloglog.h" +#include "hyperloglog.h" #include <util/generic/bitops.h> #include <util/generic/yexception.h> @@ -39,18 +39,18 @@ namespace { }; double EstimateBias(double e, unsigned precision) { - static const TCorrection CORRECTIONS[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { + static const TCorrection CORRECTIONS[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { #include "hyperloglog_corrections.inc" }; - if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) { + if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) { return 0.; } - return CORRECTIONS[precision - THyperLogLog::PRECISION_MIN].GetBias(e); + return CORRECTIONS[precision - THyperLogLog::PRECISION_MIN].GetBias(e); } double GetThreshold(unsigned precision) { - static const double THRESHOLD_DATA[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { + static const double THRESHOLD_DATA[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { 10, // Precision 4 20, // Precision 5 40, // Precision 6 @@ -67,11 +67,11 @@ namespace { 120000, // Precision 17 350000 // Precision 18 }; - if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) { + if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) { return 0.; } - return THRESHOLD_DATA[precision - THyperLogLog::PRECISION_MIN]; + return THRESHOLD_DATA[precision - THyperLogLog::PRECISION_MIN]; } double EmpiricAlpha(size_t m) { diff --git a/library/cpp/hyperloglog/hyperloglog_ut.cpp b/library/cpp/hyperloglog/hyperloglog_ut.cpp index b987aa0fa4..2aeda0d958 100644 --- a/library/cpp/hyperloglog/hyperloglog_ut.cpp +++ b/library/cpp/hyperloglog/hyperloglog_ut.cpp @@ -1,4 +1,4 @@ -#include "hyperloglog.h" +#include "hyperloglog.h" #include <util/generic/buffer.h> #include <util/random/mersenne.h> @@ -12,7 +12,7 @@ Y_UNIT_TEST_SUITE(THyperLogLog) { Y_UNIT_TEST(TestPrecision18) { TMersenne<ui64> rand; - auto counter = THyperLogLog::Create(18); + auto counter = THyperLogLog::Create(18); static const std::pair<ui64, ui64> POINTS[] = { {10, 10}, @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(THyperLogLog) { UNIT_ASSERT_EQUAL(estimation, pnt.second); } { - auto counter2 = THyperLogLog::Create(18); + auto counter2 = THyperLogLog::Create(18); while (unique < 2000000000) { const auto val = rand(); counter2.Update(val); @@ -59,7 +59,7 @@ Y_UNIT_TEST_SUITE(THyperLogLog) { UNIT_ASSERT_EQUAL(stream.Buffer().Size(), 1 + (1 << 18)); stream.Rewind(); - const auto copy = THyperLogLog::Load(stream); + const auto copy = THyperLogLog::Load(stream); UNIT_ASSERT_EQUAL(counter.Estimate(), copy.Estimate()); } diff --git a/library/cpp/hyperloglog/ut/ya.make b/library/cpp/hyperloglog/ut/ya.make index f5f1c0d25a..9f13c301b0 100644 --- a/library/cpp/hyperloglog/ut/ya.make +++ b/library/cpp/hyperloglog/ut/ya.make @@ -6,7 +6,7 @@ OWNER( ) SRCS( - hyperloglog_ut.cpp + hyperloglog_ut.cpp ) END() diff --git a/library/cpp/hyperloglog/ya.make b/library/cpp/hyperloglog/ya.make index 98dbb68c48..0b790275a5 100644 --- a/library/cpp/hyperloglog/ya.make +++ b/library/cpp/hyperloglog/ya.make @@ -6,8 +6,8 @@ OWNER( ) SRCS( - hyperloglog.h - hyperloglog.cpp + hyperloglog.h + hyperloglog.cpp ) END() |