You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2021/12/01 00:02:58 UTC

[datasketches-cpp] branch theta_setops_sync_java created (now c6d323c)

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

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


      at c6d323c  ported tests from Java, adjusted logic

This branch includes the following new commits:

     new c6d323c  ported tests from Java, adjusted logic

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


[datasketches-cpp] 01/01: ported tests from Java, adjusted logic

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c6d323ca761bcb1cf10af0f5c024263bfe7c1f21
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Tue Nov 30 16:02:44 2021 -0800

    ported tests from Java, adjusted logic
---
 theta/include/theta_intersection_base_impl.hpp   |   2 +-
 theta/include/theta_set_difference_base_impl.hpp |   2 +-
 theta/include/theta_sketch_impl.hpp              |  10 +-
 theta/test/CMakeLists.txt                        |   1 +
 theta/test/theta_setop_test.cpp                  | 355 +++++++++++++++++++++++
 theta/test/theta_sketch_test.cpp                 |   2 +-
 theta/test/theta_update_empty_from_java.sk       | Bin 1048 -> 0 bytes
 theta/test/theta_update_estimation_from_java.sk  | Bin 65560 -> 0 bytes
 tuple/include/tuple_sketch_impl.hpp              |   2 +-
 tuple/test/tuple_sketch_test.cpp                 |   5 +-
 10 files changed, 369 insertions(+), 10 deletions(-)

diff --git a/theta/include/theta_intersection_base_impl.hpp b/theta/include/theta_intersection_base_impl.hpp
index c5eed99..8f54d82 100644
--- a/theta/include/theta_intersection_base_impl.hpp
+++ b/theta/include/theta_intersection_base_impl.hpp
@@ -38,7 +38,7 @@ void theta_intersection_base<EN, EK, P, S, CS, A>::update(SS&& sketch) {
   if (table_.is_empty_) return;
   if (!sketch.is_empty() && sketch.get_seed_hash() != compute_seed_hash(table_.seed_)) throw std::invalid_argument("seed hash mismatch");
   table_.is_empty_ |= sketch.is_empty();
-  table_.theta_ = std::min(table_.theta_, sketch.get_theta64());
+  table_.theta_ = table_.is_empty_ ? theta_constants::MAX_THETA : std::min(table_.theta_, sketch.get_theta64());
   if (is_valid_ && table_.num_entries_ == 0) return;
   if (sketch.get_num_retained() == 0) {
     is_valid_ = true;
diff --git a/theta/include/theta_set_difference_base_impl.hpp b/theta/include/theta_set_difference_base_impl.hpp
index fbf4cdb..f689d5b 100644
--- a/theta/include/theta_set_difference_base_impl.hpp
+++ b/theta/include/theta_set_difference_base_impl.hpp
@@ -36,7 +36,7 @@ seed_hash_(compute_seed_hash(seed))
 template<typename EN, typename EK, typename CS, typename A>
 template<typename FwdSketch, typename Sketch>
 CS theta_set_difference_base<EN, EK, CS, A>::compute(FwdSketch&& a, const Sketch& b, bool ordered) const {
-  if (a.is_empty() || a.get_num_retained() == 0 || b.is_empty()) return CS(a, ordered);
+  if (a.is_empty() || (a.get_num_retained() > 0 && b.is_empty())) return CS(a, true);
   if (a.get_seed_hash() != seed_hash_) throw std::invalid_argument("A seed hash mismatch");
   if (b.get_seed_hash() != seed_hash_) throw std::invalid_argument("B seed hash mismatch");
 
diff --git a/theta/include/theta_sketch_impl.hpp b/theta/include/theta_sketch_impl.hpp
index 1efb4cd..ed81203 100644
--- a/theta/include/theta_sketch_impl.hpp
+++ b/theta/include/theta_sketch_impl.hpp
@@ -116,7 +116,7 @@ bool update_theta_sketch_alloc<A>::is_ordered() const {
 
 template<typename A>
 uint64_t update_theta_sketch_alloc<A>::get_theta64() const {
-  return table_.theta_;
+  return is_empty() ? theta_constants::MAX_THETA : table_.theta_;
 }
 
 template<typename A>
@@ -268,9 +268,11 @@ seed_hash_(other.get_seed_hash()),
 theta_(other.get_theta64()),
 entries_(other.get_allocator())
 {
-  entries_.reserve(other.get_num_retained());
-  std::copy(other.begin(), other.end(), std::back_inserter(entries_));
-  if (ordered && !other.is_ordered()) std::sort(entries_.begin(), entries_.end());
+  if (!other.is_empty()) {
+    entries_.reserve(other.get_num_retained());
+    std::copy(other.begin(), other.end(), std::back_inserter(entries_));
+    if (ordered && !other.is_ordered()) std::sort(entries_.begin(), entries_.end());
+  }
 }
 
 template<typename A>
diff --git a/theta/test/CMakeLists.txt b/theta/test/CMakeLists.txt
index 7df65c4..147708f 100644
--- a/theta/test/CMakeLists.txt
+++ b/theta/test/CMakeLists.txt
@@ -43,4 +43,5 @@ target_sources(theta_test
     theta_intersection_test.cpp
     theta_a_not_b_test.cpp
     theta_jaccard_similarity_test.cpp
+    theta_setop_test.cpp
 )
diff --git a/theta/test/theta_setop_test.cpp b/theta/test/theta_setop_test.cpp
new file mode 100644
index 0000000..ed70d5a
--- /dev/null
+++ b/theta/test/theta_setop_test.cpp
@@ -0,0 +1,355 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <sstream>
+
+#include <catch.hpp>
+#include <theta_union.hpp>
+#include <theta_intersection.hpp>
+#include <theta_a_not_b.hpp>
+
+namespace datasketches {
+
+static const uint64_t GT_MIDP_V  = 3L;
+static const float MIDP          = 0.5f;
+
+static const uint64_t GT_LOWP_V  = 6L;
+static const float LOWP          = 0.1f;
+static const long LT_LOWP_V      = 4L;
+
+static const double LOWP_THETA   = LOWP;
+
+enum SkType {
+  EMPTY,      // { 1.0,  0, T} Bin: 101  Oct: 05
+  EXACT,      // { 1.0, >0, F} Bin: 110  Oct: 06, specify only value
+  ESTIMATION, // {<1.0, >0, F} Bin: 010  Oct: 02, specify only value
+  DEGENERATE  // {<1.0,  0, F} Bin: 000  Oct: 00, specify p, value
+};
+
+void check_result(std::string comment, compact_theta_sketch sk, double theta, uint32_t entries, bool empty) {
+  bool thetaOk = sk.get_theta() == theta;
+  bool entriesOk = sk.get_num_retained() == entries;
+  bool emptyOk = sk.is_empty() == empty;
+  if (!thetaOk || !entriesOk || !emptyOk) {
+    std::ostringstream s;
+    s << comment << ": ";
+    if (!thetaOk)   { s << "theta: expected " << theta << ", got " << sk.get_theta() << "; "; }
+    if (!entriesOk) { s << "entries: expected " << entries << ", got " << sk.get_num_retained() << "; "; }
+    if (!emptyOk)   { s << "empty: expected " << empty << ", got " << sk.is_empty() << "."; }
+    FAIL(s.str());
+  }
+}
+
+update_theta_sketch build_sketch(SkType skType, float p, uint64_t value) {
+  update_theta_sketch::builder bldr;
+  bldr.set_lg_k(5);
+
+  switch(skType) {
+    case EMPTY: { // { 1.0,  0, T}
+      return bldr.build();
+    }
+    case EXACT: { // { 1.0, >0, F}
+      auto sk = bldr.build();
+      sk.update(value);
+      return sk;
+    }
+    case ESTIMATION: { // {<1.0, >0, F}
+      bldr.set_p(p);
+      auto sk = bldr.build();
+      sk.update(value);
+      return sk;
+    }
+    case DEGENERATE: { // {<1.0,  0, F}
+      bldr.set_p(p);
+      auto sk = bldr.build();
+      sk.update(value); // > theta
+      return sk;
+    }
+    default: throw std::invalid_argument("invalid case");
+  }
+}
+
+void checks(
+  update_theta_sketch& a,
+  update_theta_sketch& b,
+  double resultInterTheta,
+  uint32_t resultInterCount,
+  bool resultInterEmpty,
+  double resultAnotbTheta,
+  uint32_t resultAnotbCount,
+  bool resultAnotbEmpty
+) {
+  {
+    theta_intersection inter;
+    inter.update(a);
+    inter.update(b);
+    auto csk = inter.get_result();
+    check_result("Intersection update sketches", csk, resultInterTheta, resultInterCount, resultInterEmpty);
+  }
+  {
+    theta_intersection inter;
+    inter.update(a.compact());
+    inter.update(b.compact());
+    auto csk = inter.get_result();
+    check_result("Intersection compact sketches", csk, resultInterTheta, resultInterCount, resultInterEmpty);
+  }
+  {
+    theta_a_not_b a_not_b;
+    auto csk = a_not_b.compute(a, b);
+    check_result("AnotB update sketches", csk, resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+  }
+  {
+    theta_a_not_b a_not_b;
+    auto csk = a_not_b.compute(a.compact(), b.compact());
+    check_result("AnotB compact sketches", csk, resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+  }
+}
+
+
+TEST_CASE("empty empty") {
+  auto a = build_sketch(SkType::EMPTY, 0, 0);
+  auto b = build_sketch(SkType::EMPTY, 0, 0);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = true;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("empty exact") {
+  auto a = build_sketch(SkType::EMPTY, 0, 0);
+  auto b = build_sketch(SkType::EXACT, 0, GT_MIDP_V);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = true;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("empty degenerate") {
+  auto a = build_sketch(SkType::EMPTY, 0, 0);
+  auto b = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = true;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("empty estimation") {
+  auto a = build_sketch(SkType::EMPTY, 0, 0);
+  auto b = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = true;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+// ---
+
+TEST_CASE("exact empty") {
+  auto a = build_sketch(SkType::EXACT, 0, GT_MIDP_V);
+  auto b = build_sketch(SkType::EMPTY, 0, 0);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 1;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("exact exact") {
+  auto a = build_sketch(SkType::EXACT, 0, GT_MIDP_V);
+  auto b = build_sketch(SkType::EXACT, 0, GT_MIDP_V);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 1;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = 1.0;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = true;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("exact degenerate") {
+  auto a = build_sketch(SkType::EXACT, 0, LT_LOWP_V);
+  auto b = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V); //entries = 0
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 1;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("exact estimation") {
+  auto a = build_sketch(SkType::EXACT, 0, LT_LOWP_V);
+  auto b = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 1;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+// ---
+
+TEST_CASE("estimation empty") {
+  auto a = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  auto b = build_sketch(SkType::EMPTY, 0, 0);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 1;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("estimation exact") {
+  auto a = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  auto b = build_sketch(SkType::EXACT, 0, LT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 1;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("estimation degenerate") {
+  auto a = build_sketch(SkType::ESTIMATION, MIDP, LT_LOWP_V);
+  auto b = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 1;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("estimation estimation") {
+  auto a = build_sketch(SkType::ESTIMATION, MIDP, LT_LOWP_V);
+  auto b = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 1;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+// ---
+
+TEST_CASE("degenerate empty") {
+  auto a = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V); //entries = 0
+  auto b = build_sketch(SkType::EMPTY, 0, 0);
+  const double resultInterTheta = 1.0;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = true;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("degenerate exact") {
+  auto a = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V); //entries = 0
+  auto b = build_sketch(SkType::EXACT, 0, LT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("degenerate degenerate") {
+  auto a = build_sketch(SkType::DEGENERATE, MIDP, GT_MIDP_V); //entries = 0
+  auto b = build_sketch(SkType::DEGENERATE, LOWP, GT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+TEST_CASE("degenerate estimation") {
+  auto a = build_sketch(SkType::DEGENERATE, MIDP, GT_MIDP_V); //entries = 0
+  auto b = build_sketch(SkType::ESTIMATION, LOWP, LT_LOWP_V);
+  const double resultInterTheta = LOWP_THETA;
+  const int resultInterCount = 0;
+  const bool resultInterEmpty = false;
+  const double resultAnotbTheta = LOWP_THETA;
+  const int resultAnotbCount = 0;
+  const bool resultAnotbEmpty = false;
+
+  checks(a, b, resultInterTheta, resultInterCount, resultInterEmpty,
+      resultAnotbTheta, resultAnotbCount, resultAnotbEmpty);
+}
+
+} /* namespace datasketches */
diff --git a/theta/test/theta_sketch_test.cpp b/theta/test/theta_sketch_test.cpp
index c8283de..c162bea 100644
--- a/theta/test/theta_sketch_test.cpp
+++ b/theta/test/theta_sketch_test.cpp
@@ -71,7 +71,7 @@ TEST_CASE("theta sketch: non empty no retained keys", "[theta_sketch]") {
   update_sketch.reset();
   REQUIRE(update_sketch.is_empty());
   REQUIRE_FALSE(update_sketch.is_estimation_mode());
-  REQUIRE(update_sketch.get_theta() == Approx(0.001));
+  REQUIRE(update_sketch.get_theta() == 1.0);
   REQUIRE(update_sketch.get_estimate() == 0.0);
   REQUIRE(update_sketch.get_lower_bound(1) == 0.0);
   REQUIRE(update_sketch.get_upper_bound(1) == 0.0);
diff --git a/theta/test/theta_update_empty_from_java.sk b/theta/test/theta_update_empty_from_java.sk
deleted file mode 100644
index 7456dfb..0000000
Binary files a/theta/test/theta_update_empty_from_java.sk and /dev/null differ
diff --git a/theta/test/theta_update_estimation_from_java.sk b/theta/test/theta_update_estimation_from_java.sk
deleted file mode 100644
index 43b11b0..0000000
Binary files a/theta/test/theta_update_estimation_from_java.sk and /dev/null differ
diff --git a/tuple/include/tuple_sketch_impl.hpp b/tuple/include/tuple_sketch_impl.hpp
index 37b0436..8d7af33 100644
--- a/tuple/include/tuple_sketch_impl.hpp
+++ b/tuple/include/tuple_sketch_impl.hpp
@@ -104,7 +104,7 @@ bool update_tuple_sketch<S, U, P, A>::is_ordered() const {
 
 template<typename S, typename U, typename P, typename A>
 uint64_t update_tuple_sketch<S, U, P, A>::get_theta64() const {
-  return map_.theta_;
+  return is_empty() ? theta_constants::MAX_THETA : map_.theta_;
 }
 
 template<typename S, typename U, typename P, typename A>
diff --git a/tuple/test/tuple_sketch_test.cpp b/tuple/test/tuple_sketch_test.cpp
index 39d7265..9ddb695 100644
--- a/tuple/test/tuple_sketch_test.cpp
+++ b/tuple/test/tuple_sketch_test.cpp
@@ -34,7 +34,6 @@ std::ostream& operator<<(std::ostream& os, const three_doubles& tuple) {
 
 #include <catch.hpp>
 #include <tuple_sketch.hpp>
-//#include <test_type.hpp>
 
 namespace datasketches {
 
@@ -43,9 +42,11 @@ TEST_CASE("tuple sketch float: builder", "[tuple_sketch]") {
   builder.set_lg_k(10).set_p(0.5f).set_resize_factor(theta_constants::resize_factor::X2).set_seed(123);
   auto sketch = builder.build();
   REQUIRE(sketch.get_lg_k() == 10);
-  REQUIRE(sketch.get_theta() == 0.5);
+  REQUIRE(sketch.get_theta() == 1.0); // empty sketch should have theta 1.0
   REQUIRE(sketch.get_rf() == theta_constants::resize_factor::X2);
   REQUIRE(sketch.get_seed_hash() == compute_seed_hash(123));
+  sketch.update(1, 0);
+  REQUIRE(sketch.get_theta() == 0.5); // theta = p
 }
 
 TEST_CASE("tuple sketch float: empty", "[tuple_sketch]") {

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