|
ADS
Algorithms and Data Structures
|
The engineered operations on words and on arrays of words, beyond the book [see Bitwise.h for the broadword tricks of Knuth, which compute the same results by the identities of his section 7.1.3 alone]. More...
#include "ADS/Contract.h"#include "ADS/Simd.h"#include "ADS/combinatorial/Bitwise.h"#include "ADS/succinct/BitVector.h"#include <bit>#include <cstddef>#include <cstdint>#include <utility>#include "ADS/combinatorial/impl/FastBitwise.tpp"Go to the source code of this file.
Namespaces | |
| namespace | ADS |
Functions | |
| std::uint64_t | ADS::popcount (const Word *w, std::size_t n) |
| the 1 bits of the \( n \) words from \( w \) | |
| std::uint64_t | ADS::popcountAnd (const Word *a, const Word *b, std::size_t n) |
| the 1 bits of the \( n \) words of \( a \,\&\, b \) | |
| Word | ADS::pdep (Word x, Word mask) |
| the low bits of \( x \) to the places of the 1 bits of mask, in order | |
| Word | ADS::pext (Word x, Word mask) |
| the bits of \( x \) at the places of the 1 bits of mask, packed low | |
| int | ADS::select (Word x, int r) |
| the place of the 1 of rank \( r \) of \( x \), from 0 | |
| Word | ADS::mortonEncode (std::uint32_t x, std::uint32_t y) |
| the Morton code of \( ( x , y ) \), the bits of \( x \) in the even places and those of \( y \) in the odd ones | |
| std::pair< std::uint32_t, std::uint32_t > | ADS::mortonDecode (Word z) |
| the \( ( x , y ) \) of the Morton code \( z \) | |
The engineered operations on words and on arrays of words, beyond the book [see Bitwise.h for the broadword tricks of Knuth, which compute the same results by the identities of his section 7.1.3 alone].
The contracts [see Contract.h]: select( x , r ) needs \( r \) smaller than the number of 1 bits of \( x \). The functions are defined in FastBitwise.tpp.