Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eabeed9

Browse filesBrowse files
committed
Rename size_real to size_f32 throughout codebase
1 parent 8e62968 commit eabeed9
Copy full SHA for eabeed9

File tree

Expand file treeCollapse file tree

6 files changed

+16
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+16
-16
lines changed
Open diff view settings
Collapse file

‎crates/geo_filters/src/config.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/config.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ pub(crate) mod tests {
374374
m.push_hash(rnd.next_u64());
375375
}
376376
// Compute the relative error between estimate and actually inserted items.
377-
let high_precision = m.size_real() / cnt as f32 - 1.0;
377+
let high_precision = m.size_f32() / cnt as f32 - 1.0;
378378
// Take the average over trials many attempts.
379379
avg_precision += high_precision / trials as f32;
380380
avg_var += high_precision.powf(2.0) / trials as f32;
Collapse file

‎crates/geo_filters/src/diff_count.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/diff_count.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,11 @@ impl<C: GeoConfig<Diff>> Count<Diff> for GeoDiffCount<'_, C> {
443443
*self = xor(self, other);
444444
}
445445

446-
fn size_real(&self) -> f32 {
446+
fn size_f32(&self) -> f32 {
447447
self.estimate_size()
448448
}
449449

450-
fn size_with_sketch_real(&self, other: &Self) -> f32 {
450+
fn size_with_sketch_f32(&self, other: &Self) -> f32 {
451451
assert!(
452452
self.config == other.config,
453453
"combined filters must have the same configuration"
@@ -501,7 +501,7 @@ mod tests {
501501
let mut geo_count = GeoDiffCount13::default();
502502

503503
(0..n).for_each(|i| geo_count.push(i));
504-
assert_eq!(result, geo_count.size_real());
504+
assert_eq!(result, geo_count.size_f32());
505505
}
506506
}
507507

Collapse file

‎crates/geo_filters/src/distinct_count.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/distinct_count.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<C: GeoConfig<Distinct>> Count<Distinct> for GeoDistinctCount<'_, C> {
143143
*self = or(self, other)
144144
}
145145

146-
fn size_real(&self) -> f32 {
146+
fn size_f32(&self) -> f32 {
147147
let lowest_bucket = self.lsb.bit_range().start;
148148
let total = self.msb.len()
149149
+ self
@@ -159,7 +159,7 @@ impl<C: GeoConfig<Distinct>> Count<Distinct> for GeoDistinctCount<'_, C> {
159159
}
160160
}
161161

162-
fn size_with_sketch_real(&self, other: &Self) -> f32 {
162+
fn size_with_sketch_f32(&self, other: &Self) -> f32 {
163163
assert!(
164164
self.config == other.config,
165165
"combined filters must have the same configuration"
@@ -272,7 +272,7 @@ mod tests {
272272
] {
273273
let mut geo_count = GeoDistinctCount13::default();
274274
(0..n).for_each(|i| geo_count.push(i));
275-
assert_eq!(result, geo_count.size_real());
275+
assert_eq!(result, geo_count.size_f32());
276276
}
277277
}
278278

Collapse file

‎crates/geo_filters/src/evaluation/hll.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/evaluation/hll.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ impl<C: HllConfig> Count<Distinct> for Hll<C> {
126126
unimplemented!()
127127
}
128128

129-
fn size_real(&self) -> f32 {
129+
fn size_f32(&self) -> f32 {
130130
self.inner.borrow_mut().count() as f32
131131
}
132132

133-
fn size_with_sketch_real(&self, _other: &Self) -> f32 {
133+
fn size_with_sketch_f32(&self, _other: &Self) -> f32 {
134134
unimplemented!()
135135
}
136136

Collapse file

‎crates/geo_filters/src/evaluation/simulation.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/evaluation/simulation.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<C: GeoConfig<Diff> + Clone> SimulationCount for GeoDiffCount<'_, C> {
2525
<Self as Count<_>>::push_hash(self, hash)
2626
}
2727
fn size(&self) -> f32 {
28-
<Self as Count<_>>::size_real(self)
28+
<Self as Count<_>>::size_f32(self)
2929
}
3030
fn bytes_in_memory(&self) -> usize {
3131
<Self as Count<_>>::bytes_in_memory(self)
@@ -36,7 +36,7 @@ impl<C: GeoConfig<Distinct>> SimulationCount for GeoDistinctCount<'_, C> {
3636
<Self as Count<_>>::push_hash(self, hash)
3737
}
3838
fn size(&self) -> f32 {
39-
<Self as Count<_>>::size_real(self)
39+
<Self as Count<_>>::size_f32(self)
4040
}
4141
fn bytes_in_memory(&self) -> usize {
4242
<Self as Count<_>>::bytes_in_memory(self)
@@ -47,7 +47,7 @@ impl<C: HllConfig> SimulationCount for Hll<C> {
4747
<Self as Count<_>>::push_hash(self, hash)
4848
}
4949
fn size(&self) -> f32 {
50-
<Self as Count<_>>::size_real(self)
50+
<Self as Count<_>>::size_f32(self)
5151
}
5252
fn bytes_in_memory(&self) -> usize {
5353
<Self as Count<_>>::bytes_in_memory(self)
Collapse file

‎crates/geo_filters/src/lib.rs‎

Copy file name to clipboardExpand all lines: crates/geo_filters/src/lib.rs
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ pub trait Count<M: Method> {
4545

4646
/// Return the estimated set size rounded to the nearest unsigned integer.
4747
fn size(&self) -> usize {
48-
let size = self.size_real().round();
48+
let size = self.size_f32().round();
4949
debug_assert_f32s_in_range(size);
5050
size as usize
5151
}
5252

5353
/// Return the estimated set size as a real number.
54-
fn size_real(&self) -> f32;
54+
fn size_f32(&self) -> f32;
5555

5656
/// Return the estimated set size when combined with the given sketch rounded to the nearest unsigned integer.
5757
/// If the combined set itself is not going to be used, this method is more efficient than using [`Self::push_sketch`] and [`Self::size`].
5858
fn size_with_sketch(&self, other: &Self) -> usize {
59-
let size = self.size_with_sketch_real(other).round();
59+
let size = self.size_with_sketch_f32(other).round();
6060
debug_assert_f32s_in_range(size);
6161
size as usize
6262
}
6363

6464
/// Return the estimated set size when combined with the given sketch as a real number.
6565
/// If the combined set itself is not going to be used, this method is more efficient than using [`Self::push_sketch`] and [`Self::size`].
66-
fn size_with_sketch_real(&self, other: &Self) -> f32;
66+
fn size_with_sketch_f32(&self, other: &Self) -> f32;
6767

6868
/// Returns the number of bytes in memory used to represent this filter.
6969
fn bytes_in_memory(&self) -> usize;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.