diff options
author | vitamin-ca <vitamin-ca@yandex-team.ru> | 2022-02-10 16:50:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:46 +0300 |
commit | 33975e98548306c90ccdc156bc436408a213be00 (patch) | |
tree | f3f70f93263e848986d3f52e04e4e9a980e224b0 /library/cpp/hyperloglog/hyperloglog.h | |
parent | a175286682787b2d1213734c5be7458aaf594c1c (diff) | |
download | ydb-33975e98548306c90ccdc156bc436408a213be00.tar.gz |
Restoring authorship annotation for <vitamin-ca@yandex-team.ru>. Commit 1 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 e79ee0ed77..f5c09cdc41 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>>; |