aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/hyperloglog/hyperloglog.h
diff options
context:
space:
mode:
authorvitamin-ca <vitamin-ca@yandex-team.ru>2022-02-10 16:50:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:46 +0300
commit33975e98548306c90ccdc156bc436408a213be00 (patch)
treef3f70f93263e848986d3f52e04e4e9a980e224b0 /library/cpp/hyperloglog/hyperloglog.h
parenta175286682787b2d1213734c5be7458aaf594c1c (diff)
downloadydb-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.h50
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>>;