pasta_bit_vector  1.0.1
Bit Vector with Compact and Fast Rank and Select Support
Loading...
Searching...
No Matches
popcount.hpp File Reference
#include <bit>
#include <cstdint>
#include <iostream>
Include dependency graph for popcount.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<size_t Words>
uint64_t pasta::popcount (uint64_t const *const buffer)
 Compute popcount of a specific number of 64-bit words.
 
template<size_t Words>
uint64_t pasta::popcount_zeros (uint64_t const *const buffer)
 Counts the number of zero bits in a specific number of 64-bit words.
 

Function Documentation

◆ popcount()

template<size_t Words>
uint64_t pasta::popcount ( uint64_t const *const buffer)
nodiscard

Compute popcount of a specific number of 64-bit words.

Note that there are no bound checks.

Template Parameters
WordsNumber of 64-bit words the popcount is computed for.
Parameters
bufferPointer to the beginning of the 64-bit words.
Returns
Popcount of the Words * 64 bits starting at buffer.

◆ popcount_zeros()

template<size_t Words>
uint64_t pasta::popcount_zeros ( uint64_t const *const buffer)
nodiscard

Counts the number of zero bits in a specific number of 64-bit words.

Note that there are no bound checks.

Template Parameters
WordsNumber of 64-bit words the zeros are counted in.
Parameters
bufferPointer to the beginning of the 64-bit words.
Returns
Number of zeros in the Words * 64 bits starting at buffer.