8 #ifndef INCLUDED_SDSL_LCP_WT
9 #define INCLUDED_SDSL_LCP_WT
37 template <u
int8_t t_w
idth = 0>
69 typedef std::pair<size_type, size_type> tPII;
70 typedef std::vector<tPII> tVPII;
84 std::string temp_file =
tmp_file(config,
"_lcp_sml");
86 if (
"" != other_key) { lcp_key = other_key; }
93 if ((l = lcp_buf[i]) < 255) { small_lcp[i] = l; }
97 if (l > max_l) max_l = l;
110 for (
size_type i = 0, ii = 0; i < n; ++i)
112 if (lcp_buf[i] >= 255) { m_big_lcp[ii++] = lcp_buf[i]; }
137 if (m_small_lcp[i] != 255) {
return m_small_lcp[i]; }
140 return m_big_lcp[m_small_lcp.
rank(i, 255)];
149 written_bytes += m_small_lcp.
serialize(out, child,
"small_lcp");
150 written_bytes += m_big_lcp.
serialize(out, child,
"large_lcp");
152 return written_bytes;
158 m_small_lcp.
load(in);
162 template <
typename archive_t>
169 template <
typename archive_t>
179 return (m_small_lcp == other.m_small_lcp) && (m_big_lcp == other.m_big_lcp);
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.
lcp_wt & operator=(const lcp_wt &)=default
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
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
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(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.
lcp_wt(const lcp_wt &)=default
Copy / Move constructor.
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
lcp_wt & operator=(lcp_wt &&)=default
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 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)
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.
iterators.hpp contains an generic iterator for random access containers.
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.
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.
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.
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.