You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2019/06/21 21:31:08 UTC

[incubator-datasketches-cpp] 01/01: restore missing load_factor

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch lg_size_bugfix
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git

commit 8a3020cfdf610efe023c7ebe7472cb037308f93c
Author: Jon Malkin <jm...@users.noreply.github.com>
AuthorDate: Fri Jun 21 14:31:03 2019 -0700

    restore missing load_factor
---
 theta/include/theta_sketch.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/theta/include/theta_sketch.hpp b/theta/include/theta_sketch.hpp
index 5abc5e9..bd2ec1d 100644
--- a/theta/include/theta_sketch.hpp
+++ b/theta/include/theta_sketch.hpp
@@ -301,7 +301,7 @@ constexpr uint8_t lg_size_from_count(uint32_t n, double load_factor) {
   //uint8_t lg = log2(n) + 1;
   //if (n > (1 << lg) * load_factor) lg++;
   //return lg;
-  return log2(n) + (n > (1 << (log2(n) + 1)) ? 2 : 1);
+  return log2(n) + ((n > (1 << (log2(n) + 1)) * load_factor) ? 2 : 1);
 }
 
 } /* namespace datasketches */


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org