81#ifndef __ADS_PartitionedEliasFano
82 #define __ADS_PartitionedEliasFano
161 [[nodiscard]] std::size_t
size(
void )
const {
return( f_n ); }
164 [[nodiscard]]
bool empty(
void )
const {
return( f_n == 0 ); }
167 [[nodiscard]] std::uint64_t
universe(
void )
const {
return( f_u ); }
192 [[nodiscard]] std::uint64_t
access( std::size_t i )
const;
196 [[nodiscard]] std::uint64_t
operator[]( std::size_t i )
const {
230 [[nodiscard]] std::size_t
nextGEQ( std::uint64_t x )
const;
233 [[nodiscard]]
bool contains( std::uint64_t x )
const;
237 [[nodiscard]] std::array< std::size_t , 3 >
kinds(
void )
const;
246 static constexpr std::string_view
persistName =
"PartitionedEliasFano";
253 [[nodiscard]]
static constexpr std::uint64_t
persistTag(
void ) {
254 return( detail::persistMix( { kB , kS , kSample } ) );
295 static constexpr std::size_t kB = 128;
296 static constexpr std::size_t kS = 16;
297 static constexpr std::size_t kSample = 64;
314 [[nodiscard]]
static Code code( std::uint64_t m , std::uint64_t u );
325 [[nodiscard]] Record record( std::size_t j )
const;
328 [[nodiscard]] std::uint64_t relBase( std::size_t j )
const {
329 return( f_rec[ j * f_s ] & f_mb );
336 [[nodiscard]] std::size_t select( std::size_t p , std::size_t k )
const;
339 [[nodiscard]] std::size_t ones( std::size_t p , std::size_t q )
const;
343 using Array = std::vector< T , MappableAllocator< T > >;
346 std::uint64_t f_u = 0;
347 std::uint64_t f_last = 0;
349 Array< std::uint64_t > f_rec;
350 Array< std::uint64_t > f_sup;
351 Array< std::uint32_t > f_bkt;
354 int f_wb = 1 , f_wo = 1 , f_ws = 1;
356 std::uint64_t f_mb = 1 , f_mo = 1 , f_ms = 1;
368#include "ADS/succinct/impl/PartitionedEliasFano.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....
const_iterator cbegin(void) const
the same as begin()
Definition PartitionedEliasFano.h:289
std::ptrdiff_t difference_type
the type of the distance of two places
Definition PartitionedEliasFano.h:269
std::uint64_t universe(void) const
the bound of the items
Definition PartitionedEliasFano.h:167
std::size_t size(void) const
the number of items,
Definition PartitionedEliasFano.h:161
std::uint64_t operator[](std::size_t i) const
the item , as access()
Definition PartitionedEliasFano.h:196
SubscriptIterator< PartitionedEliasFano, std::uint64_t > const_iterator
the constant iterator, random access
Definition PartitionedEliasFano.h:275
std::uint64_t value_type
the type of an item
Definition PartitionedEliasFano.h:265
const_iterator begin(void) const
the iterator on the first item
Definition PartitionedEliasFano.h:281
std::size_t size_type
the type of a size
Definition PartitionedEliasFano.h:267
bool contains(std::uint64_t x) const
whether is in the sequence, by nextGEQ()
PartitionedEliasFano(void)=default
the empty sequence
const_iterator end(void) const
the iterator past the last item
Definition PartitionedEliasFano.h:285
std::size_t nextGEQ(std::uint64_t x) const
the place of the first item , size() if none
std::uint64_t access(std::size_t i) const
the item
static constexpr std::uint32_t persistVersion
the version of the layout in a file: 2, that of the records of whole words and of the buckets
Definition PartitionedEliasFano.h:250
PartitionedEliasFano(std::span< const std::uint64_t > x)
the sequence , with the universe
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
static constexpr std::uint64_t persistTag(void)
the items of a block, in a file
Definition PartitionedEliasFano.h:253
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition PartitionedEliasFano.h:246
PartitionedEliasFano(std::span< const std::uint64_t > x, std::uint64_t u)
the sequence in
bool empty(void) const
whether there is no item
Definition PartitionedEliasFano.h:164
std::uint64_t const_reference
an item, returned by value
Definition PartitionedEliasFano.h:273
std::size_t sizeInBits(void) const
the bits of the codes, of the records, of the superblocks and of the buckets
std::array< std::size_t, 3 > kinds(void) const
the numbers of the full blocks, of those coded as vectors and of those coded by Elias-Fano
const_iterator cend(void) const
the same as end()
Definition PartitionedEliasFano.h:291
const_iterator iterator
the same as const_iterator
Definition PartitionedEliasFano.h:278
std::uint64_t reference
an item, returned by value
Definition PartitionedEliasFano.h:271
the random-access constant iterator on the items T of the owner O, read by ( *o )[ i ]
Definition BitVector.h:372