36 template <
typename Letter>
38 std::vector<int> &
lcp, std::vector<Letter>
const &sumWords) {
39 int comonPrefixLength = 0;
40 for (
auto suffixRank :
42 if (suffixRank != 0) {
43 while (sumWords[suffix_array[suffixRank] + comonPrefixLength] ==
44 sumWords[suffix_array[suffixRank - 1] + comonPrefixLength]) {
48 lcp[suffixRank] = comonPrefixLength;
49 if (comonPrefixLength > 0) {
56 #endif // PAAL_LCP_HPP
void lcp(std::vector< int > const &suffix_array, std::vector< int > const &rank, std::vector< int > &lcp, std::vector< Letter > const &sumWords)
fill array lcp lcp[0] is undefined and lcp[i] stores the largest common prefix of the lexicographical...
void suffix_array(std::vector< Letter > &text, std::vector< int > &SA, Letter max_letter=0)
detail
void rank(std::vector< T > const &m_id_to_t, std::vector< Idx > &m_t_to_id, int INVALID_IDX=0)
computes rank i.e. index of element in range