diff options
| author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:15 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:15 +0300 | 
| commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
| tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/hyperloglog | |
| parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/hyperloglog')
| -rw-r--r-- | library/cpp/hyperloglog/hyperloglog.cpp | 50 | ||||
| -rw-r--r-- | library/cpp/hyperloglog/hyperloglog.h | 2 | ||||
| -rw-r--r-- | library/cpp/hyperloglog/hyperloglog_ut.cpp | 18 | 
3 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/hyperloglog/hyperloglog.cpp b/library/cpp/hyperloglog/hyperloglog.cpp index ec8352abe14..c162fad798e 100644 --- a/library/cpp/hyperloglog/hyperloglog.cpp +++ b/library/cpp/hyperloglog/hyperloglog.cpp @@ -40,7 +40,7 @@ namespace {      double EstimateBias(double e, unsigned precision) {          static const TCorrection CORRECTIONS[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { -#include "hyperloglog_corrections.inc" +#include "hyperloglog_corrections.inc"           };          if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) {              return 0.; @@ -51,21 +51,21 @@ namespace {      double GetThreshold(unsigned precision) {          static const double THRESHOLD_DATA[1 + THyperLogLog::PRECISION_MAX - THyperLogLog::PRECISION_MIN] = { -            10,     // Precision  4 -            20,     // Precision  5 -            40,     // Precision  6 -            80,     // Precision  7 -            220,    // Precision  8 -            400,    // Precision  9 -            900,    // Precision 10 -            1800,   // Precision 11 -            3100,   // Precision 12 -            6500,   // Precision 13 -            11500,  // Precision 14 -            20000,  // Precision 15 -            50000,  // Precision 16 -            120000, // Precision 17 -            350000  // Precision 18 +            10,     // Precision  4  +            20,     // Precision  5  +            40,     // Precision  6  +            80,     // Precision  7  +            220,    // Precision  8  +            400,    // Precision  9  +            900,    // Precision 10  +            1800,   // Precision 11  +            3100,   // Precision 12  +            6500,   // Precision 13  +            11500,  // Precision 14  +            20000,  // Precision 15  +            50000,  // Precision 16  +            120000, // Precision 17  +            350000  // Precision 18           };          if (precision < THyperLogLog::PRECISION_MIN || precision > THyperLogLog::PRECISION_MAX) {              return 0.; @@ -76,14 +76,14 @@ namespace {      double EmpiricAlpha(size_t m) {          switch (m) { -            case 16: -                return 0.673; -            case 32: -                return 0.697; -            case 64: -                return 0.709; -            default: -                return 0.7213 / (1.0 + 1.079 / m); +            case 16:  +                return 0.673;  +            case 32:  +                return 0.697;  +            case 64:  +                return 0.709;  +            default:  +                return 0.7213 / (1.0 + 1.079 / m);           }      } @@ -109,7 +109,7 @@ void THyperLogLogBase::Update(ui64 hash) {      const unsigned subHashBits = 8 * sizeof(hash) - Precision;      const auto subHash = hash & MaskLowerBits(subHashBits);      const auto leadingZeroes = subHash ? (subHashBits - GetValueBitCount(subHash)) : subHashBits; -    const ui8 weight = static_cast<ui8>(leadingZeroes + 1); +    const ui8 weight = static_cast<ui8>(leadingZeroes + 1);       const size_t reg = static_cast<size_t>(hash >> subHashBits);      RegistersRef[reg] = std::max(RegistersRef[reg], weight); diff --git a/library/cpp/hyperloglog/hyperloglog.h b/library/cpp/hyperloglog/hyperloglog.h index e79ee0ed77f..d0a6e7376d6 100644 --- a/library/cpp/hyperloglog/hyperloglog.h +++ b/library/cpp/hyperloglog/hyperloglog.h @@ -42,7 +42,7 @@ private:  public:      THyperLogLogWithAlloc(THyperLogLogWithAlloc&&) = default; - +       THyperLogLogWithAlloc& operator=(THyperLogLogWithAlloc&&) = default;      static THyperLogLogWithAlloc Create(unsigned precision) { diff --git a/library/cpp/hyperloglog/hyperloglog_ut.cpp b/library/cpp/hyperloglog/hyperloglog_ut.cpp index b987aa0fa4a..7218536bce0 100644 --- a/library/cpp/hyperloglog/hyperloglog_ut.cpp +++ b/library/cpp/hyperloglog/hyperloglog_ut.cpp @@ -15,15 +15,15 @@ Y_UNIT_TEST_SUITE(THyperLogLog) {          auto counter = THyperLogLog::Create(18);          static const std::pair<ui64, ui64> POINTS[] = { -            {10, 10}, -            {100, 100}, -            {1000, 998}, -            {10000, 9978}, -            {100000, 99995}, -            {1000000, 997017}, -            {10000000, 9983891}, -            {100000000, 100315572}, -            {1000000000, 998791445}, +            {10, 10},  +            {100, 100},  +            {1000, 998},  +            {10000, 9978},  +            {100000, 99995},  +            {1000000, 997017},  +            {10000000, 9983891},  +            {100000000, 100315572},  +            {1000000000, 998791445},               //1:37: {10000000000, 10015943904}          };          ui64 unique = 0;  | 
