From dcf307481950f91154d7d37c37311b5a2c0ad1c6 Mon Sep 17 00:00:00 2001 From: "J. Zhao" Date: Thu, 19 Mar 2020 20:21:12 +0800 Subject: [PATCH] hll: move constexpr from .h to .cpp --- adv/hll.cpp | 5 +++++ adv/hll.h | 7 ------- graph/hyperanf.h | 2 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/adv/hll.cpp b/adv/hll.cpp index d58af1a..207dd5f 100644 --- a/adv/hll.cpp +++ b/adv/hll.cpp @@ -6,6 +6,11 @@ #include "hll.h" namespace hll { +constexpr uint8_t CLZ_TABLE_4BIT[16] = {4, 3, 2, 2, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0}; +constexpr uint64_t L8 = 0x0101010101010101; +constexpr uint64_t H8 = 0x8080808080808080; +constexpr uint64_t A1 = 0xffffffffffffffff; double alpha(const int m) { switch (m) { diff --git a/adv/hll.h b/adv/hll.h index f4971aa..9428392 100644 --- a/adv/hll.h +++ b/adv/hll.h @@ -11,12 +11,6 @@ namespace hll { -constexpr uint8_t CLZ_TABLE_4BIT[16] = {4, 3, 2, 2, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0}; -constexpr uint64_t L8 = 0x0101010101010101; -constexpr uint64_t H8 = 0x8080808080808080; -constexpr uint64_t A1 = 0xffffffffffffffff; - double alpha(const int m); double beta(const double ez); @@ -43,7 +37,6 @@ bool isGreaterEqual(const uint64_t& x, const uint64_t& y); */ double count(const uint8_t* reg, const int m); - } /* namespace hll */ #endif /* __HYPER_LOGLOG_COUNTING_H__ */ diff --git a/graph/hyperanf.h b/graph/hyperanf.h index 60bf52d..8a28346 100644 --- a/graph/hyperanf.h +++ b/graph/hyperanf.h @@ -35,7 +35,6 @@ class HyperANF { /** * Merge HLL counter at pos_j to HLL counter at pos_i. * B(C_i) := max(B(C_i), B(C_j)) - * Return true if value in pos_i is changed. */ inline void mergeCounter(const int pos_i, const int pos_j) { for (int k = 0; k < units_per_counter_; k++) { @@ -46,7 +45,6 @@ class HyperANF { /** * Merge counter at pos to given target. - * Return true if value in pos_i is changed. */ inline void mergeCounter(uint64_t* target, const int pos) const { for (int k = 0; k < units_per_counter_; k++) {