Skip to main content

boolean_buffer_and_then

Function boolean_buffer_and_then 

Source
pub fn boolean_buffer_and_then(
    left: &BooleanBuffer,
    right: &BooleanBuffer,
) -> BooleanBuffer
Expand description

Combines this BooleanBuffer with another using logical AND on the selected bits.

Unlike intersection, the other BooleanBuffer must have exactly as many set bits as self, i.e., self.count_set_bits() == other.len().

This method will keep only the bits in self that are also set in other at the positions corresponding to self’s set bits. For example: left: NNYYYNNYYNYN right: YNY NY N result: NNYNYNNNYNNN

Optimized version of boolean_buffer_and_then using BMI2 PDEP instructions. This function performs the same operation but uses bit manipulation instructions for better performance on supported x86_64 CPUs.