8#ifndef INCLUDED_SDSL_LCP_BYTE
9#define INCLUDED_SDSL_LCP_BYTE
44template <u
int8_t t_w
idth = 0>
76 typedef std::pair<size_type, size_type> tPII;
77 typedef std::vector<tPII> tVPII;
93 size_type l = 0, max_l = 0, max_big_idx = 0, big_sum = 0;
95 for (
size_type i = 0; i < m_small_lcp.size(); ++i)
97 if ((l = lcp_buf[i]) < 255)
103 m_small_lcp[i] = 255;
113 for (
size_type i = 0, ii = 0; i < m_small_lcp.size(); ++i)
115 if ((l = lcp_buf[i]) >= 255)
118 m_big_lcp_idx[ii] = i;
127 return m_small_lcp.size();
139 return m_small_lcp.empty();
160 if (m_small_lcp[i] != 255)
162 return m_small_lcp[i];
166 size_type idx = std::lower_bound(m_big_lcp_idx.begin(), m_big_lcp_idx.end(), i) - m_big_lcp_idx.begin();
167 return m_big_lcp[idx];
176 written_bytes += m_small_lcp.serialize(out, child,
"small_lcp");
177 written_bytes += m_big_lcp.serialize(out, child,
"large_lcp");
178 written_bytes += m_big_lcp_idx.serialize(out, child,
"large_lcp_idx");
180 return written_bytes;
186 m_small_lcp.load(in);
188 m_big_lcp_idx.load(in);
191 template <
typename archive_t>
199 template <
typename archive_t>
210 return (m_small_lcp == other.m_small_lcp) && (m_big_lcp == other.m_big_lcp)
211 && (m_big_lcp_idx == other.m_big_lcp_idx);
217 return !(*
this == other);
bits.hpp contains the sdsl::bits class.
cereal.hpp offers cereal support
uint64_t size() const
Returns the number of elements currently stored.
A generic vector class for integers of width .
int_vector_size_type size_type
int_vector_trait< t_width >::value_type value_type
static size_type max_size() noexcept
Maximum size of the int_vector.
lcp_byte(cache_config &config)
Constructor.
const_iterator end() const
Returns a const_iterator to the element after the last element.
void load(std::istream &in)
Load from a stream.
int_vector< t_width >::value_type value_type
lcp_byte()=default
Default Constructor.
lcp_byte & operator=(lcp_byte &&)=default
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
const_reference reference
int_vector ::size_type size_type
bool operator==(lcp_byte const &other) const noexcept
Equality operator.
random_access_const_iterator< lcp_byte > const_iterator
lcp_byte(lcp_byte const &)=default
value_type operator[](size_type i) const
[]-operator
bool operator!=(lcp_byte const &other) const noexcept
Inequality operator.
ptrdiff_t difference_type
lcp_byte(lcp_byte &&)=default
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serialize to a stream.
const_reference * pointer
const value_type const_reference
lcp_plain_tag lcp_category
lcp_byte & operator=(lcp_byte const &)=default
const pointer const_pointer
size_type size() const
Number of elements in the instance.
static size_type max_size()
Returns the largest size that lcp_byte can ever have.
const_iterator begin() const
Returns a const_iterator to the first element.
bool empty() const
Returns if the data strucutre is empty.
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
Generic iterator for a random access container.
static structure_tree_node * add_child(structure_tree_node *v, std::string const &name, std::string const &type)
static void add_size(structure_tree_node *v, uint64_t value)
int_vector.hpp contains the sdsl::int_vector class.
int_vector_buffer.hpp contains the sdsl::int_vector_buffer class.
io.hpp contains some methods for reading/writing sdsl structures.
iterators.hpp contains an generic iterator for random access containers.
Namespace for the succinct data structure library.
std::string cache_file_name(std::string const &key, cache_config const &config)
Returns the file name of the resource.
Contains declarations and definitions of data structure concepts.
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.
structure_tree.hpp contains a helper class which can represent the memory structure of a class.
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.