63#ifndef __ADS_LoudsTree
64 #define __ADS_LoudsTree
96 static constexpr std::size_t
nil = std::size_t( -1 );
121 explicit LoudsTree(
const std::vector< std::vector< std::size_t > > & c );
128 [[nodiscard]] std::size_t
size(
void )
const;
131 [[nodiscard]] std::size_t
root(
void )
const;
138 [[nodiscard]] std::size_t
degree( std::size_t v )
const;
144 [[nodiscard]] std::size_t
parent( std::size_t v )
const;
160 [[nodiscard]] std::size_t
child( std::size_t v , std::size_t i )
const;
164 [[nodiscard]]
bool isLeaf( std::size_t v )
const;
183 [[nodiscard]]
bool valid(
void )
const;
197#include "ADS/succinct/impl/LoudsTree.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,...
Rank and select on a static vector of bits of bits with 1s (chapter 15, Compressed Data Structures...
a vector of bits packed in words of 64 bits
Definition BitVector.h:479
std::size_t leftmostChild(std::size_t v) const
the first child of , nil for a leaf, i.e., when a 0 follows the -th 1
LoudsTree(BitVector b)
the tree whose code is
std::size_t child(std::size_t v, std::size_t i) const
the child of , from 0, i.e.,
std::size_t rightSibling(std::size_t v) const
the next sibling of , nil for the last one, i.e., when a 0 follows the 0 of
std::size_t parent(std::size_t v) const
the parent of , nil for the root, i.e., , the 1s before the 0 of less the one of the dummy root
std::size_t size(void) const
the number of nodes
std::size_t degree(std::size_t v) const
the number of children of , the 0s between the -th 1 and the next, i.e., with the ranks counted from...
const BitVector & bits(void) const
, the code
std::size_t root(void) const
the root, nil if the tree is empty
LoudsTree(void)
the empty tree
static constexpr std::size_t nil
no node
Definition LoudsTree.h:96
bool isLeaf(std::size_t v) const
whether has no children
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition LoudsTree.h:172
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
LoudsTree(const std::vector< std::vector< std::size_t > > &c)
the tree whose node has the children , in order, rooted at 0
BasicRankSelect< false > RankSelect
the directory with its inventories of select built in the constructor, the fastest select
Definition RankSelect.h:556