ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
FastBitwise.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*--------------------------- File FastBitwise.h ---------------------------*/
3/*--------------------------------------------------------------------------*/
48/*--------------------------------------------------------------------------*/
49/*----------------------------- DEFINITIONS --------------------------------*/
50/*--------------------------------------------------------------------------*/
51
52#ifndef __ADS_FastBitwise
53 #define __ADS_FastBitwise
54/* self-identification: #endif constant */
55
56/*--------------------------------------------------------------------------*/
57/*------------------------------ INCLUDES ----------------------------------*/
58/*--------------------------------------------------------------------------*/
59
60#include "ADS/Contract.h"
61#include "ADS/Simd.h"
64
65#include <bit>
66#include <cstddef>
67#include <cstdint>
68#include <utility>
69
70/*--------------------------------------------------------------------------*/
71/*--------------------------- NAMESPACE ------------------------------------*/
72/*--------------------------------------------------------------------------*/
73
74namespace ADS
75{
76
109[[nodiscard]] inline std::uint64_t popcount( const Word * w , std::size_t n );
110
122[[nodiscard]] inline std::uint64_t popcountAnd( const Word * a ,
123 const Word * b ,
124 std::size_t n );
125
140[[nodiscard]] inline Word pdep( Word x , Word mask );
141
156[[nodiscard]] inline Word pext( Word x , Word mask );
157
180[[nodiscard]] inline int select( Word x , int r );
181
194[[nodiscard]] inline Word mortonEncode( std::uint32_t x , std::uint32_t y );
195
207[[nodiscard]] inline std::pair< std::uint32_t , std::uint32_t >
209
210/*--------------------------------------------------------------------------*/
211
212} // end( namespace ADS )
213
214/*--------------------------------------------------------------------------*/
215/*-------------------------- IMPLEMENTATION --------------------------------*/
216/*--------------------------------------------------------------------------*/
217
218#include "ADS/combinatorial/impl/FastBitwise.tpp"
219
220/*--------------------------------------------------------------------------*/
221
222#endif /* FastBitwise.h included */
223
224/*--------------------------------------------------------------------------*/
225/*------------------------ End File FastBitwise.h --------------------------*/
226/*--------------------------------------------------------------------------*/
The vector of bits on which the succinct structures and the integer codes of ADS are built: the bits ...
The broadword tricks of Knuth (section 7.1.3 of The Art of Computer Programming), beyond the book: op...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The vector kernels of ADS on Google Highway, with ADS_WITH_HIGHWAY: the loops over arrays that a stru...
std::uint64_t popcountAnd(const Word *a, const Word *b, std::size_t n)
the 1 bits of the words of
Word pext(Word x, Word mask)
the bits of at the places of the 1 bits of mask, packed low
int select(Word x, int r)
the place of the 1 of rank of , from 0
Word pdep(Word x, Word mask)
the low bits of to the places of the 1 bits of mask, in order
std::pair< std::uint32_t, std::uint32_t > mortonDecode(Word z)
the of the Morton code
std::uint64_t popcount(const Word *w, std::size_t n)
the 1 bits of the words from
Word mortonEncode(std::uint32_t x, std::uint32_t y)
the Morton code of , the bits of in the even places and those of in the odd ones
Definition ADT.h:96
std::uint64_t Word
a word of 64 bits
Definition Bitwise.h:73