Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datasketches/src/cpc/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl CpcSketch {
///
/// # Panics
///
/// Panics if `lg_k` is not in the range `[4, 16]`.
/// Panics if `lg_k` is not in the range `[4, 26]`.
pub fn new(lg_k: u8) -> Self {
Self::with_seed(lg_k, DEFAULT_UPDATE_SEED)
}
Expand All @@ -106,7 +106,7 @@ impl CpcSketch {
///
/// # Panics
///
/// Panics if `lg_k` is not in the range `[4, 16]`, or the computed seed hash is zero.
/// Panics if `lg_k` is not in the range `[4, 26]`, or the computed seed hash is zero.
pub fn with_seed(lg_k: u8, seed: u64) -> Self {
assert!(
(MIN_LG_K..=MAX_LG_K).contains(&lg_k),
Expand Down
4 changes: 2 additions & 2 deletions datasketches/src/cpc/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl CpcUnion {
///
/// # Panics
///
/// Panics if `lg_k` is not in the range `[4, 16]`.
/// Panics if `lg_k` is not in the range `[4, 26]`.
pub fn new(lg_k: u8) -> Self {
Self::with_seed(lg_k, DEFAULT_UPDATE_SEED)
}
Expand All @@ -100,7 +100,7 @@ impl CpcUnion {
///
/// # Panics
///
/// Panics if `lg_k` is not in the range `[4, 16]`.
/// Panics if `lg_k` is not in the range `[4, 26]`.
pub fn with_seed(lg_k: u8, seed: u64) -> Self {
// We begin with the accumulator holding an EMPTY_MERGED sketch object.
let sketch = CpcSketch::with_seed(lg_k, seed);
Expand Down
14 changes: 4 additions & 10 deletions datasketches/src/theta/bit_pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4974,17 +4974,14 @@ fn unpack_bits_63(values: &mut [u64], bytes: &[u8]) {
///
/// * Panics if `values.len()` is not equal to `BLOCK_WIDTH`.
/// * Panics if `bits` is not in the range `1..=63`.
/// * Panics if `bytes.len()` is less than `bits * BLOCK_WIDTH`.
/// * Panics if `bytes.len()` is less than `bits`.
pub(crate) fn pack_bits_block(values: &[u64], bytes: &mut [u8], bits: u8) {
assert_eq!(values.len(), BLOCK_WIDTH, "values length must be 8");
assert!(
(1..=63).contains(&bits),
"wrong number of bits in pack_bits_block8: {bits}"
);
assert!(
bytes.len() < bits as usize * BLOCK_WIDTH,
"output buffer too small"
);
assert!(bytes.len() >= bits as usize, "output buffer too small");

match bits {
1 => pack_bits_1(values, bytes),
Expand Down Expand Up @@ -5060,17 +5057,14 @@ pub(crate) fn pack_bits_block(values: &[u64], bytes: &mut [u8], bits: u8) {
///
/// * Panics if `values.len()` is not equal to `BLOCK_WIDTH`.
/// * Panics if `bits` is not in the range `1..=63`.
/// * Panics if `bytes.len()` is less than `bits * BLOCK_WIDTH`.
/// * Panics if `bytes.len()` is less than `bits`.
pub(crate) fn unpack_bits_block(values: &mut [u64], bytes: &[u8], bits: u8) {
assert_eq!(values.len(), BLOCK_WIDTH, "values length must be 8");
assert!(
(1..=63).contains(&bits),
"wrong number of bits in unpack_bits_block8: {bits}"
);
assert!(
bytes.len() < bits as usize * BLOCK_WIDTH,
"input buffer too small"
);
assert!(bytes.len() >= bits as usize, "output buffer too small");

match bits {
1 => unpack_bits_1(values, bytes),
Expand Down