8#ifndef INCLUDED_SDSL_LCP_WT
9#define INCLUDED_SDSL_LCP_WT
43template <u
int8_t t_w
idth = 0>
75 typedef std::pair<size_type, size_type> tPII;
76 typedef std::vector<tPII> tVPII;
90 std::string temp_file =
tmp_file(config,
"_lcp_sml");
102 if ((l = lcp_buf[i]) < 255)
123 for (
size_type i = 0, ii = 0; i < n; ++i)
125 if (lcp_buf[i] >= 255)
127 m_big_lcp[ii++] = lcp_buf[i];
136 return m_small_lcp.
size();
148 return 0 == m_small_lcp.
size();
168 if (m_small_lcp[i] != 255)
170 return m_small_lcp[i];
174 return m_big_lcp[m_small_lcp.
rank(i, 255)];
183 written_bytes += m_small_lcp.
serialize(out, child,
"small_lcp");
184 written_bytes += m_big_lcp.
serialize(out, child,
"large_lcp");
186 return written_bytes;
192 m_small_lcp.
load(in);
196 template <
typename archive_t>
203 template <
typename archive_t>
213 return (m_small_lcp == other.m_small_lcp) && (m_big_lcp == other.m_big_lcp);
219 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 .
void load(std::istream &in)
Load the int_vector for a stream.
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.
A class for the compressed version of lcp information of an suffix array.
random_access_const_iterator< lcp_wt > const_iterator
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
lcp_plain_tag lcp_category
bool operator!=(lcp_wt const &other) const noexcept
Inequality operator.
const value_type const_reference
static size_type max_size()
Returns the largest size that lcp_wt can ever have.
lcp_wt()=default
Default Constructor.
int_vector< t_width >::value_type value_type
lcp_wt & operator=(lcp_wt &&)=default
int_vector ::size_type size_type
void load(std::istream &in)
Load from a stream.
ptrdiff_t difference_type
const pointer const_pointer
value_type operator[](size_type i) const
[]-operator
lcp_wt & operator=(lcp_wt const &)=default
bool operator==(lcp_wt const &other) const noexcept
Equality operator.
bool empty() const
Returns if the data structure is empty.
const_iterator begin() const
Returns a const_iterator to the first element.
size_type size() const
Number of elements in the instance.
const_reference * pointer
const_reference reference
lcp_wt(lcp_wt const &)=default
Copy / Move constructor.
lcp_wt(cache_config &config, std::string other_key="")
Constructor.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serialize to a stream.
const_iterator end() const
Returns a const_iterator to the element after the last element.
wt_huff< bit_vector, rank_support_v<>, select_support_scan< 1 >, select_support_scan< 0 > > small_lcp_type
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
lcp_wt(lcp_wt &&)=default
Generic iterator for a random access container.
A class supporting linear time select queries.
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)
A prefix code-shaped wavelet.
size_type rank(size_type i, value_type c) const
Calculates how many symbols c are in the prefix [0..i-1].
void load(std::istream &in)
Loads the data structure from the given istream.
size_type size() const
Returns the size of the original vector.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serializes the data structure into the given ostream.
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.
int remove(std::string const &)
Remove a file.
std::string tmp_file(cache_config const &config, std::string name_part="")
Returns a name for a temporary file. I.e. the name was not used before.
std::string cache_file_name(std::string const &key, cache_config const &config)
Returns the file name of the resource.
bool store_to_file(T const &v, std::string const &file)
Store a data structure to a file.
Contains declarations and definitions of data structure concepts.
select_support_scan.hpp contains classes that support a sdsl::bit_vector with linear time select.
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.
wt_huff.hpp contains a class for a Huffman shaped wavelet tree over byte sequences.