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

tisonkun pushed a commit to branch codex/theta-view-coupon-naming
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git

commit 2aabb8a92b2e63263bdb78773a742e073aa00166
Author: tison <[email protected]>
AuthorDate: Sat Jul 25 23:29:54 2026 +0800

    refactor(theta): align raw theta64 naming
---
 datasketches/src/theta/sketch.rs             | 4 ++--
 datasketches/src/thetacommon/a_not_b.rs      | 4 ++--
 datasketches/src/thetacommon/intersection.rs | 4 ++--
 datasketches/src/thetacommon/mod.rs          | 2 +-
 datasketches/src/thetacommon/union.rs        | 4 ++--
 datasketches/src/tuple/sketch.rs             | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/datasketches/src/theta/sketch.rs b/datasketches/src/theta/sketch.rs
index ed354b2..405331d 100644
--- a/datasketches/src/theta/sketch.rs
+++ b/datasketches/src/theta/sketch.rs
@@ -67,7 +67,7 @@ impl RawThetaSketchView<ThetaEntry> for ThetaSketch {
         ThetaSketch::seed_hash(self)
     }
 
-    fn theta(&self) -> u64 {
+    fn theta64(&self) -> u64 {
         ThetaSketch::theta64(self)
     }
 
@@ -867,7 +867,7 @@ impl RawThetaSketchView<ThetaEntry> for CompactThetaSketch {
         CompactThetaSketch::seed_hash(self)
     }
 
-    fn theta(&self) -> u64 {
+    fn theta64(&self) -> u64 {
         CompactThetaSketch::theta64(self)
     }
 
diff --git a/datasketches/src/thetacommon/a_not_b.rs 
b/datasketches/src/thetacommon/a_not_b.rs
index dbe22a0..af1ac53 100644
--- a/datasketches/src/thetacommon/a_not_b.rs
+++ b/datasketches/src/thetacommon/a_not_b.rs
@@ -88,7 +88,7 @@ impl RawThetaAnotB {
             )));
         }
 
-        let theta = a.theta().min(b.theta());
+        let theta = a.theta64().min(b.theta64());
         // A is non-empty here; the result only becomes empty if everything is 
subtracted in exact
         // mode (handled below).
         let mut is_empty = false;
@@ -175,7 +175,7 @@ impl RawThetaAnotB {
         }
         RawCompactParts {
             entries,
-            theta: a.theta(),
+            theta: a.theta64(),
             seed_hash: a.seed_hash(),
             ordered: out_ordered,
             empty: a.is_empty(),
diff --git a/datasketches/src/thetacommon/intersection.rs 
b/datasketches/src/thetacommon/intersection.rs
index 5a60eef..4c0fa88 100644
--- a/datasketches/src/thetacommon/intersection.rs
+++ b/datasketches/src/thetacommon/intersection.rs
@@ -105,7 +105,7 @@ where
         self.table.set_theta(if self.table.is_empty() {
             MAX_THETA
         } else {
-            self.table.theta().min(sketch.theta())
+            self.table.theta().min(sketch.theta64())
         });
 
         if self.has_result && self.table.num_retained() == 0 {
@@ -285,7 +285,7 @@ mod tests {
             crate::hash::compute_seed_hash(DEFAULT_UPDATE_SEED)
         }
 
-        fn theta(&self) -> u64 {
+        fn theta64(&self) -> u64 {
             MAX_THETA
         }
 
diff --git a/datasketches/src/thetacommon/mod.rs 
b/datasketches/src/thetacommon/mod.rs
index 458f092..4dc4ee8 100644
--- a/datasketches/src/thetacommon/mod.rs
+++ b/datasketches/src/thetacommon/mod.rs
@@ -39,7 +39,7 @@ pub trait RawThetaSketchView<E: RawHashTableEntry> {
     fn seed_hash(&self) -> u16;
 
     /// Return theta as a `u64` threshold.
-    fn theta(&self) -> u64;
+    fn theta64(&self) -> u64;
 
     /// Return whether this sketch has not received any updates.
     fn is_empty(&self) -> bool;
diff --git a/datasketches/src/thetacommon/union.rs 
b/datasketches/src/thetacommon/union.rs
index c9ea9fe..ab04a55 100644
--- a/datasketches/src/thetacommon/union.rs
+++ b/datasketches/src/thetacommon/union.rs
@@ -77,7 +77,7 @@ where
         }
 
         self.table.set_empty(false);
-        self.union_theta = self.union_theta.min(sketch.theta());
+        self.union_theta = self.union_theta.min(sketch.theta64());
 
         for entry in sketch.iter() {
             let hash = entry.hash();
@@ -180,7 +180,7 @@ mod tests {
             crate::hash::compute_seed_hash(DEFAULT_UPDATE_SEED)
         }
 
-        fn theta(&self) -> u64 {
+        fn theta64(&self) -> u64 {
             MAX_THETA
         }
 
diff --git a/datasketches/src/tuple/sketch.rs b/datasketches/src/tuple/sketch.rs
index 501ebcc..8efea74 100644
--- a/datasketches/src/tuple/sketch.rs
+++ b/datasketches/src/tuple/sketch.rs
@@ -257,7 +257,7 @@ where
         self.table.seed_hash()
     }
 
-    fn theta(&self) -> u64 {
+    fn theta64(&self) -> u64 {
         self.table.theta()
     }
 
@@ -571,7 +571,7 @@ impl<S: Clone> RawThetaSketchView<TupleEntry<S>> for 
CompactTupleSketch<S> {
         self.seed_hash
     }
 
-    fn theta(&self) -> u64 {
+    fn theta64(&self) -> u64 {
         self.theta
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to