diff --git a/src/hll/aux_map.rs b/src/hll/aux_map.rs index 33e2fdb..89ca08f 100644 --- a/src/hll/aux_map.rs +++ b/src/hll/aux_map.rs @@ -20,7 +20,7 @@ //! Stores slot-value pairs for values that don't fit in the 4-bit main array. //! Uses open addressing with stride-based probing for collision resolution. -use crate::hll::{RESIZE_DENOM, RESIZE_NUMER, get_slot, get_value, pack_coupon}; +use crate::hll::{RESIZE_DENOM, RESIZE_NUMERATOR, get_slot, get_value, pack_coupon}; const ENTRY_EMPTY: u32 = 0; @@ -175,7 +175,7 @@ impl AuxMap { /// Check if we need to grow the hash table (75% load factor) fn check_grow(&mut self) { let size = 1 << self.lg_size; - if (RESIZE_DENOM * self.count) > (RESIZE_NUMER * size) { + if (RESIZE_DENOM * self.count) > (RESIZE_NUMERATOR * size) { self.grow(); } } diff --git a/src/hll/cubic_interpolation.rs b/src/hll/cubic_interpolation.rs index fa6f211..bc0cd38 100644 --- a/src/hll/cubic_interpolation.rs +++ b/src/hll/cubic_interpolation.rs @@ -122,20 +122,20 @@ fn cubic_interpolate( y3: f64, x: f64, ) -> f64 { - let l0_numer = (x - x1) * (x - x2) * (x - x3); - let l1_numer = (x - x0) * (x - x2) * (x - x3); - let l2_numer = (x - x0) * (x - x1) * (x - x3); - let l3_numer = (x - x0) * (x - x1) * (x - x2); + let l0_numerator = (x - x1) * (x - x2) * (x - x3); + let l1_numerator = (x - x0) * (x - x2) * (x - x3); + let l2_numerator = (x - x0) * (x - x1) * (x - x3); + let l3_numerator = (x - x0) * (x - x1) * (x - x2); let l0_denom = (x0 - x1) * (x0 - x2) * (x0 - x3); let l1_denom = (x1 - x0) * (x1 - x2) * (x1 - x3); let l2_denom = (x2 - x0) * (x2 - x1) * (x2 - x3); let l3_denom = (x3 - x0) * (x3 - x1) * (x3 - x2); - let term0 = y0 * l0_numer / l0_denom; - let term1 = y1 * l1_numer / l1_denom; - let term2 = y2 * l2_numer / l2_denom; - let term3 = y3 * l3_numer / l3_denom; + let term0 = y0 * l0_numerator / l0_denom; + let term1 = y1 * l1_numerator / l1_denom; + let term2 = y2 * l2_numerator / l2_denom; + let term3 = y3 * l3_numerator / l3_denom; term0 + term1 + term2 + term3 } diff --git a/src/hll/mod.rs b/src/hll/mod.rs index 28f56cd..0f18d58 100644 --- a/src/hll/mod.rs +++ b/src/hll/mod.rs @@ -99,7 +99,7 @@ const KEY_MASK_26: u32 = (1 << KEY_BITS_26) - 1; const COUPON_RSE_FACTOR: f64 = 0.409; // At transition point not the asymptote const COUPON_RSE: f64 = COUPON_RSE_FACTOR / (1 << 13) as f64; -const RESIZE_NUMER: u32 = 3; // Resize at 3/4 = 75% load factor +const RESIZE_NUMERATOR: u32 = 3; // Resize at 3/4 = 75% load factor const RESIZE_DENOM: u32 = 4; /// Extract slot number (low 26 bits) from coupon diff --git a/src/hll/sketch.rs b/src/hll/sketch.rs index f22679b..12fca3a 100644 --- a/src/hll/sketch.rs +++ b/src/hll/sketch.rs @@ -30,7 +30,7 @@ use crate::hll::container::Container; use crate::hll::hash_set::HashSet; use crate::hll::list::List; use crate::hll::serialization::*; -use crate::hll::{HllType, NumStdDev, RESIZE_DENOM, RESIZE_NUMER, coupon}; +use crate::hll::{HllType, NumStdDev, RESIZE_DENOM, RESIZE_NUMERATOR, coupon}; /// Current sketch mode #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -120,7 +120,7 @@ impl HllSketch { Mode::Set { set, hll_type } => { set.update(coupon); let should_promote = RESIZE_DENOM as usize * set.container().len() - > RESIZE_NUMER as usize * set.container().capacity(); + > RESIZE_NUMERATOR as usize * set.container().capacity(); if should_promote { self.mode = if set.container().lg_size() == self.lg_config_k as usize - 3 { promote_container_to_array(set.container(), *hll_type, self.lg_config_k) diff --git a/typos.toml b/typos.toml index c27efec..f48ac54 100644 --- a/typos.toml +++ b/typos.toml @@ -16,7 +16,7 @@ # under the License. [default.extend-words] -"NUMER" = "NUMER" +"PREINTS" = "PREINTS" [files] extend-exclude = []