8 #ifndef INCLUDED_SDSL_LCP_BYTE
9 #define INCLUDED_SDSL_LCP_BYTE
38 template <u
int8_t t_w
idth = 0>
70 typedef std::pair<size_type, size_type> tPII;
71 typedef std::vector<tPII> tVPII;
87 size_type l = 0, max_l = 0, max_big_idx = 0, big_sum = 0;
91 if ((l = lcp_buf[i]) < 255) { m_small_lcp[i] = l; }
95 if (l > max_l) max_l = l;
105 if ((l = lcp_buf[i]) >= 255)
108 m_big_lcp_idx[ii] = i;
135 if (m_small_lcp[i] != 255) {
return m_small_lcp[i]; }
139 return m_big_lcp[idx];
148 written_bytes += m_small_lcp.
serialize(out, child,
"small_lcp");
149 written_bytes += m_big_lcp.
serialize(out, child,
"large_lcp");
150 written_bytes += m_big_lcp_idx.
serialize(out, child,
"large_lcp_idx");
152 return written_bytes;
158 m_small_lcp.
load(in);
160 m_big_lcp_idx.
load(in);
163 template <
typename archive_t>
171 template <
typename archive_t>
182 return (m_small_lcp == other.m_small_lcp) && (m_big_lcp == other.m_big_lcp) &&
183 (m_big_lcp_idx == other.m_big_lcp_idx);
uint64_t size() const
Returns the number of elements currently stored.
A generic vector class for integers of width .
iterator end() noexcept
Iterator that points to the element after the last element of int_vector.
bool empty() const noexcept
Equivalent to size() == 0.
void load(std::istream &in)
Load the int_vector for a stream.
size_type size() const noexcept
The number of elements in the int_vector.
int_vector_trait< t_width >::value_type value_type
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serializes the int_vector to a stream.
static size_type max_size() noexcept
Maximum size of the int_vector.
iterator begin() noexcept
Iterator that points to the first element of the int_vector.
A class for a simple compressed version of LCP information.
lcp_byte(cache_config &config)
Constructor.
const_iterator end() const
Returns a const_iterator to the element after the last element.
lcp_byte(const lcp_byte &)=default
void load(std::istream &in)
Load from a stream.
int_vector< t_width >::value_type value_type
lcp_byte()=default
Default Constructor.
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
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
const pointer const_pointer
lcp_byte & operator=(lcp_byte &&)=default
lcp_byte & operator=(const lcp_byte &)=default
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 void add_size(structure_tree_node *v, uint64_t value)
static structure_tree_node * add_child(structure_tree_node *v, const std::string &name, const std::string &type)
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.
static SDSL_CONSTEXPR uint32_t hi(uint64_t x)
Position of the most significant set bit the 64-bit word x.
Helper class for construction process.