Skip to main content

encode_and_popcount

Function encode_and_popcount 

Source
pub fn encode_and_popcount<R: Rng + ?Sized>(
    weight_words: &[u64],
    prob: f64,
    length: usize,
    rng: &mut R,
) -> u64
Expand description

Fused encode+AND+popcount without materializing encoded input words.

Semantically equivalent to:

  1. encoded = bernoulli_packed_simd(prob, length, rng)
  2. sum(popcount(encoded[word] & weight_words[word]))