62#include <sdsl/int_vector.hpp>
85 sdsl::bit_vector v( b.
size() , 0 );
87 std::memcpy( v.data() , b.
words().data() ,
88 ( b.
size() + 63 ) / 64 *
sizeof(
Word ) );
99 std::span< const Word >( v.data() , ( v.size() + 63 ) / 64 ) , v.size() ) );
104template<
unsigned B ,
bool S >
107 sdsl::int_vector< B > v( a.
size() , 0 , B );
109 std::memcpy( v.data() , a.
words().data() ,
110 ( a.
size() * B + 63 ) / 64 *
sizeof(
Word ) );
120template<
unsigned B ,
bool S = false , std::u
int8_t W >
121[[nodiscard]] PackedArray< B , S >
125 const std::size_t n = v.
size();
126 if( v.width() == B ) {
129 return( P( std::span< const Word >( v.data() , ( n * B + 63 ) / 64 ) , n ) );
132 for( std::size_t i = 0 ; i < n ; ++i )
133 if( std::uint64_t( v[ i ] ) > P::MAX )
134 throw( std::invalid_argument(
"ADS::toPackedArray: a field of the "
135 "int_vector of more bits than B" ) );
139 [ & ]( std::size_t i ) {
return(
typename P::Word( v[ i ] ) ); } ) );
The vector of bits on which the succinct structures and the integer codes of ADS are built: the bits ...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
Arrays of small unsigned integers packed in words, beyond the book:
a vector of bits packed in words of 64 bits
Definition BitVector.h:479
const Words & words(void) const
the words, the bits past the size being 0; they are at least , a multiple of 8, and start on a line o...
std::size_t size(void) const
the number of bits
unsigned fields of bits, to a word, the values above clamped to it if Saturate
Definition PackedArray.h:96
const std::vector< Word > & words(void) const
the words, the field in the word , the bits past the last field 0
Definition PackedArray.h:193
std::size_t size(void) const
the number of fields,
Definition PackedArray.h:152
the executor of the calling thread alone, which makes the calls in their order
Definition Executor.h:265
PackedArray< B, S > toPackedArray(const ArrowArray &a, const ArrowSchema &s)
the column of type copied into a PackedArray< B , S >: a column of booleans if ,...
Definition Arrow.h:567
BitVector toBitVector(const ArrowArray &a, const ArrowSchema &s)
the column of booleans of type copied into a BitVector; and are only read
Definition Arrow.h:539
sdsl::bit_vector toSdsl(const BitVector &b)
the bits of as a bit_vector of sdsl-lite, by a copy of the words
Definition Sdsl.h:83
std::uint64_t Word
a word of 64 bits
Definition Bitwise.h:73