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:07 UTC

[incubator-datasketches-cpp] branch lg_size_bugfix created (now 8a3020c)

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

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


      at 8a3020c  restore missing load_factor

This branch includes the following new commits:

     new 8a3020c  restore missing load_factor

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


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

Posted by jm...@apache.org.
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