4#ifndef INCLUDED_SDSL_SUPPORT_LCP_TREE
5#define INCLUDED_SDSL_SUPPORT_LCP_TREE
34 while (!vec_stack.
empty() and x < vec_stack.
top())
37 if (vec_stack.
pop()) { fc_lcp[fc_cnt++] = y; }
42 while (!vec_stack.
empty())
45 if (vec_stack.
pop()) { fc_lcp[fc_cnt++] = y; }
47 if (fc_cnt < fc_lcp.
size())
63template <
class t_lcp,
class t_cst>
128 m_lcp = t_lcp(config, fc_lcp_key);
136 void set_cst(
const t_cst * cst) { m_cst = cst; }
160 written_bytes += m_lcp.serialize(out, child,
"lcp");
162 return written_bytes;
166 void load(std::istream & in,
const t_cst * cst =
nullptr)
172 template <
typename archive_t>
178 template <
typename archive_t>
192template <
class t_lcp = lcp_wt<>>
195 template <
class t_cst>
This class composes a virtual LCP array from a LCP arrays which is in suffix array order (e....
const_iterator begin() const
Returns a const_iterator to the first element.
_lcp_support_tree(const _lcp_support_tree &)=default
Copy/Move constructor.
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
_lcp_support_tree(cache_config &config, const t_cst *cst=nullptr)
Constructor.
bool operator==(_lcp_support_tree const &other) const noexcept
Equality operator.
const_reference * pointer
value_type operator[](size_type i) const
[]-operator
const value_type const_reference
_lcp_support_tree & operator=(const _lcp_support_tree &)=default
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serialize to a stream.
t_lcp::difference_type difference_type
const pointer const_pointer
t_lcp::size_type size_type
void load(std::istream &in, const t_cst *cst=nullptr)
Load from a stream.
bool operator!=(_lcp_support_tree const &other) const noexcept
Inequality operator.
~_lcp_support_tree()=default
random_access_const_iterator< _lcp_support_tree > const_iterator
static size_type max_size()
void set_cst(const t_cst *cst)
_lcp_support_tree()=default
Default constructor.
_lcp_support_tree & operator=(_lcp_support_tree &&)=default
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
t_lcp::value_type value_type
const_iterator end() const
Returns a const_iterator to the element after the last element.
const_reference reference
lcp_tree_compressed_tag lcp_category
_lcp_support_tree(_lcp_support_tree &&)=default
uint64_t size() const
Returns the number of elements currently stored.
void shrink_to_fit()
Free unused allocated memory.
size_type size() const noexcept
The number of elements in the int_vector.
void resize(const size_type size)
Resize the int_vector in terms of elements.
Generic iterator for a random access container.
Stack which contains elements from [0..n] in sorted order. Duplicates are possible.
bool empty() const
Returns if the stack is empty.
size_type top() const
Returns the topmost index on the stack.
bool pop()
Pop the topmost index of the stack.
bool push(size_type x)
Push the index x of vector vec onto the stack.
static structure_tree_node * add_child(structure_tree_node *v, const std::string &name, const std::string &type)
static void add_size(structure_tree_node *v, uint64_t value)
lcp.hpp contains classes for lcp information.
lcp_wt.hpp contains a (compressed) LCP array based on a WT.
int_vector ::size_type size_type
std::string to_string(const T &t, int w=1)
Namespace for the succinct data structure library.
std::string cache_file_name(const std::string &key, const cache_config &config)
Returns the file name of the resource.
std::string tmp_file(const cache_config &config, std::string name_part="")
Returns a name for a temporary file. I.e. the name was not used before.
uint64_t int_vector_size_type
bool store_to_file(const T &v, const std::string &file)
Store a data structure to a file.
int remove(const std::string &)
Remove a file.
void construct_first_child_lcp(int_vector_buffer<> &lcp_buf, int_vector<> &fc_lcp)
sorted_multi_stack_support.hpp contains a data structure for a stack which contains elements from [0....
_lcp_support_tree lcp_type
static constexpr uint32_t hi(uint64_t x)
Position of the most significant set bit the 64-bit word x.
Helper class for construction process.
Helper class which provides _lcp_support_tree the context of a CST.
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.