99#ifndef __ADS_SuffixApplications
100 #define __ADS_SuffixApplications
116#include <string_view>
152[[nodiscard]]
inline std::pair< std::size_t , std::size_t >
177[[nodiscard]]
inline std::optional< std::size_t >
182[[nodiscard]]
inline std::uint64_t
218[[nodiscard]]
inline std::string
242[[nodiscard]]
inline std::vector< std::pair< std::size_t , std::size_t > >
259 std::string_view P , std::string_view Q ,
279[[nodiscard]]
inline std::vector< std::size_t >
280kMismatches( std::string_view T , std::string_view P , std::size_t k );
306[[nodiscard]]
inline std::vector< CopyPhrase >
313[[nodiscard]]
inline std::string
324#include "ADS/string/impl/SuffixApplications.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The suffix array of a text of symbols, beyond the book: is the starting place of the -th smallest ...
The suffix tree of a text of symbols, beyond the book: the compact trie [see RadixTree in Trie....
the suffix array of a text with its , and arrays and the range minima of
Definition SuffixArray.h:497
the suffix tree of , its nodes in a vector, the root at 0
Definition SuffixTree.h:149
std::tuple< std::size_t, std::size_t, std::size_t > longestCommonSubstring(const S &P, const S &T)
the longest common substring: its length and where it ends in and , the first one found by rows of ;...
bool proximity(const SuffixArray &SA, std::string_view P, std::string_view Q, std::size_t k)
whether an occurrence of and one of start at most places apart
std::vector< std::size_t > kMismatches(std::string_view T, std::string_view P, std::size_t k)
the places where occurs in with at most mismatches
std::vector< std::pair< std::size_t, std::size_t > > maximalRepeats(const SuffixTree &ST)
the maximal repeats, as the place of an occurrence and the length
std::vector< CopyPhrase > lz77ByTree(std::string_view T)
the parsing of Ziv and Lempel of , the copies from the farthest occurrence, by the suffix tree
std::pair< std::size_t, std::size_t > longestRepeatedSubstring(const SuffixArray &SA)
the place and the length of a longest substring that occurs twice (0 and 0 if none)
std::string decodeCopyPhrases(const std::vector< CopyPhrase > &Z)
the text of a parsing, each phrase copying its symbols one at a time, so that a copy may overlap the ...
std::uint64_t distinctSubstrings(const SuffixArray &SA)
the number of distinct nonempty substrings,
std::optional< std::size_t > repeatedSubstring(const SuffixArray &SA, std::size_t L, std::size_t C)
the place of a substring of length that occurs at least times, if any
a phrase of the parsing of Ziv and Lempel: copy length symbols from distance places back,...
Definition SuffixApplications.h:130
friend bool operator==(const CopyPhrase &, const CopyPhrase &)=default
the phrases are equal field by field
std::size_t length
the symbols copied
Definition SuffixApplications.h:132
std::optional< char > next
the symbol after the copy, none at the end
Definition SuffixApplications.h:133
std::size_t distance
how far back the copy starts
Definition SuffixApplications.h:131