69#ifndef __ADS_RRRBitVector
70 #define __ADS_RRRBitVector
132 [[nodiscard]] std::size_t
size(
void )
const {
return( f_m ); }
135 [[nodiscard]] std::size_t
ones(
void )
const {
return( f_ones ); }
138 [[nodiscard]] std::size_t
zeros(
void )
const {
return( f_m - f_ones ); }
170 [[nodiscard]] std::size_t
rank1( std::size_t i )
const;
175 [[nodiscard]] std::size_t
rank0( std::size_t i )
const {
176 return( i -
rank1( i ) );
202 [[nodiscard]] std::size_t
select1( std::size_t k )
const;
209 [[nodiscard]] std::size_t
select0( std::size_t k )
const;
220 [[nodiscard]]
static constexpr std::uint64_t
persistTag(
void ) {
221 return( detail::persistMix( { std::uint64_t( kB ) , kSuper } ) );
231 static constexpr int kB = 63;
232 static constexpr std::size_t kSuper = 32;
238 std::array< std::array< std::uint64_t , 64 > , 64 > C{};
240 std::array< std::uint8_t , 64 > len{};
242 static const Tables & tables(
void );
245 static std::uint64_t offset( std::uint64_t x ,
int c );
249 static int below( std::uint64_t o ,
int c ,
int q );
252 [[nodiscard]] std::uint64_t locate( std::size_t j ,
int & c ,
253 std::size_t &
ones )
const;
256 [[nodiscard]]
int cls( std::size_t j )
const {
257 return(
int( f_cls.get( 6 * j , 6 ) ) );
261 [[nodiscard]] std::size_t select( std::size_t k ,
bool b )
const;
263 std::size_t f_m = 0 , f_ones = 0;
268 int f_wr = 1 , f_wp = 1;
280#include "ADS/succinct/impl/RRRBitVector.tpp"
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,...
A file mapped in memory, shared by the structures that are read from it in place [see Persistence....
a vector of bits packed in words of 64 bits
Definition BitVector.h:479
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition RRRBitVector.h:217
std::size_t rank1(std::size_t i) const
the number of 1s in the places
std::size_t ones(void) const
the number of 1s
Definition RRRBitVector.h:135
RRRBitVector(const BitVector &b)
the bits of , compressed
std::size_t size(void) const
the number of bits,
Definition RRRBitVector.h:132
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
std::size_t rank0(std::size_t i) const
the number of 0s in the places , i.e.,
Definition RRRBitVector.h:175
std::size_t sizeInBits(void) const
the bits of the classes, of the offsets and of the superblocks
bool operator[](std::size_t i) const
the bit , i.e., whether the rank changes past it within its block
RRRBitVector(void)
the vector of no bit
Definition RRRBitVector.h:106
static constexpr std::uint64_t persistTag(void)
the parameters of the layout of the blocks, in a file
Definition RRRBitVector.h:220
std::size_t select1(std::size_t k) const
the place of the -th 1
std::size_t zeros(void) const
the number of 0s
Definition RRRBitVector.h:138
std::size_t select0(std::size_t k) const
the place of the -th 0, as select1() above with the 0s of each block counted as its length less its c...