diff options
author | vitamin-ca <vitamin-ca@yandex-team.ru> | 2022-02-10 16:50:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:47 +0300 |
commit | 1fc0bdffa16f1d19af9025338185cc8533b09606 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/hyperloglog/hyperloglog.h | |
parent | 33975e98548306c90ccdc156bc436408a213be00 (diff) | |
download | ydb-1fc0bdffa16f1d19af9025338185cc8533b09606.tar.gz |
Restoring authorship annotation for <vitamin-ca@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/hyperloglog/hyperloglog.h')
-rw-r--r-- | library/cpp/hyperloglog/hyperloglog.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/hyperloglog/hyperloglog.h b/library/cpp/hyperloglog/hyperloglog.h index f5c09cdc415..e79ee0ed77f 100644 --- a/library/cpp/hyperloglog/hyperloglog.h +++ b/library/cpp/hyperloglog/hyperloglog.h @@ -1,30 +1,30 @@ -#pragma once - -#include <util/system/types.h> +#pragma once + +#include <util/system/types.h> #include <util/stream/input.h> #include <util/generic/array_ref.h> - -#include <vector> - -class IOutputStream; - + +#include <vector> + +class IOutputStream; + class THyperLogLogBase { protected: explicit THyperLogLogBase(unsigned precision); - -public: - static const constexpr unsigned PRECISION_MIN = 4; - - static const constexpr unsigned PRECISION_MAX = 18; - - void Update(ui64 hash); - + +public: + static const constexpr unsigned PRECISION_MIN = 4; + + static const constexpr unsigned PRECISION_MAX = 18; + + void Update(ui64 hash); + void Merge(const THyperLogLogBase& rh); - - ui64 Estimate() const; - - void Save(IOutputStream& out) const; - + + ui64 Estimate() const; + + void Save(IOutputStream& out) const; + protected: unsigned Precision; @@ -38,8 +38,8 @@ private: : THyperLogLogBase(precision) { Registers.resize(1u << precision); RegistersRef = MakeArrayRef(Registers); - } - + } + public: THyperLogLogWithAlloc(THyperLogLogWithAlloc&&) = default; @@ -57,8 +57,8 @@ public: return res; } -private: +private: std::vector<ui8, Alloc> Registers; -}; +}; using THyperLogLog = THyperLogLogWithAlloc<std::allocator<ui8>>; |