8#ifndef INCLUDED_SDSL_LCP_SUPPORT_SADA
9#define INCLUDED_SDSL_LCP_SUPPORT_SADA
40template <
class t_csa = csa_sada<>,
class t_bitvec = bit_vector,
class t_select =
typename t_bitvec::select_1_type>
79 const t_csa *&
csa = m_csa;
86 , m_data(lcp_c.m_data)
87 , m_select_support(lcp_c.m_select_support)
89 m_select_support.set_vector(&m_data);
101 *
this = std::move(tmp);
111 m_csa = std::move(lcp_c.m_csa);
112 m_data = std::move(lcp_c.m_data);
113 m_select_support = std::move(lcp_c.m_select_support);
114 m_select_support.set_vector(&m_data);
122 typedef typename t_csa::size_type
size_type;
132 for (
size_type i = 0, l = 0, old_l = 1; i < n; ++i)
135 data_cnt += l + 1 - old_l;
136 data[data_cnt++] = 1;
142 util::init_support(m_select_support, &m_data);
145 void set_csa(
const t_csa * f_csa) { m_csa = f_csa; }
154 bool empty()
const {
return m_csa->empty(); }
169 size_type s = m_select_support.select(j + 1);
178 written_bytes += m_data.serialize(out, child,
"data");
179 written_bytes += m_select_support.serialize(out, child,
"select_support");
181 return written_bytes;
185 void load(std::istream & in,
const t_csa * ccsa =
nullptr)
189 m_select_support.load(in, &m_data);
192 template <
typename archive_t>
199 template <
typename archive_t>
204 m_select_support.set_vector(&m_data);
210 return (m_data == other.m_data) && (m_select_support == other.m_select_support);
218template <
class t_bitvec = bit_vector,
class t_select =
typename t_bitvec::select_1_type>
221 template <
class t_cst>
A class to represent the LCP array in compressed form.
static size_type max_size()
Returns the largest size that _lcp_support_sada can ever have.
const_iterator begin() const
Returns a const_iterator to the first element.
_lcp_support_sada(_lcp_support_sada &&lcp_c)
Move constructor.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serialize to a stream.
void set_csa(const t_csa *f_csa)
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
random_access_const_iterator< _lcp_support_sada > const_iterator
ptrdiff_t difference_type
const_iterator end() const
Returns a const_iterator to the element after the last element.
const_reference reference
bool operator!=(_lcp_support_sada const &other) const noexcept
Inequality operator.
const_reference * pointer
lcp_permuted_tag lcp_category
const pointer const_pointer
void load(std::istream &in, const t_csa *ccsa=nullptr)
Load from a stream.
_lcp_support_sada & operator=(_lcp_support_sada &&lcp_c)
Assignment Move Operator.
int_vector ::size_type size_type
const value_type const_reference
_lcp_support_sada()
Default Constructor.
size_type size() const
Number of elements in the instance.
_lcp_support_sada(cache_config &config, const t_csa *f_csa)
Constructor.
value_type operator[](size_type i) const
[]-operator
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
bool operator==(_lcp_support_sada const &other) const noexcept
Equality operator.
_lcp_support_sada(const _lcp_support_sada &lcp_c)
Copy constructor.
_lcp_support_sada & operator=(const _lcp_support_sada &lcp_c)
Assignment Operator.
t_csa::value_type value_type
bool empty() const
Returns if the data structure is empty.
A generic vector class for integers of width .
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.
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)
csa_sada.hpp contains an implementation of the compressed suffix array.
int_vector.hpp contains the sdsl::int_vector class.
iterators.hpp contains an generic iterator for random access containers.
lcp.hpp contains classes for lcp information.
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.
int_vector< 1 > bit_vector
bit_vector is a specialization of the int_vector.
void construct_isa(cache_config &config)
bool load_from_file(T &v, const std::string &file)
Load sdsl-object v from a file.
bool cache_file_exists(const std::string &key, const cache_config &config)
Checks if the resource specified by the key exists in the cache.
select_support.hpp contains classes that support a sdsl::bit_vector with constant time select informa...
_lcp_support_sada lcp_type
Helper class for construction process.
Helper class which provides _lcp_support_sada the context of a CSA.