100#ifndef __ADS_Palindromes
101 #define __ADS_Palindromes
115#include <string_view>
116#include <type_traits>
166 requires std::is_class_v< S >
167[[nodiscard]] std::pair< std::size_t , std::size_t >
182 requires std::is_class_v< S >
187[[nodiscard]]
inline std::string
223 requires std::is_class_v< S >
228[[nodiscard]]
inline std::string
263 requires std::is_class_v< S >
268[[nodiscard]]
inline std::vector< std::string >
317 bool add(
unsigned char c );
321 return( f_len.size() - 2 );
326 return( std::size_t( f_len[ f_last ] ) );
330 [[nodiscard]] std::size_t
size(
void )
const {
return( f_s.size() ); }
334 friend std::vector< std::string >
339 [[nodiscard]] std::uint32_t extensible( std::uint32_t v ,
340 unsigned char c )
const;
343 std::vector< long > f_len;
344 std::vector< std::uint32_t > f_link;
345 std::vector< long > f_diff;
346 std::vector< std::uint32_t > f_series;
347 std::vector< std::vector< std::pair< unsigned char , std::uint32_t > > >
349 std::uint32_t f_last = 1;
379[[nodiscard]]
inline std::vector< std::string >
390#include "ADS/string/impl/Palindromes.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The longest common subsequence (LCS) of and , the reality check of section 13.7 of the book: ,...
Eertree(std::string_view s)
the eertree of , by add() on each of its bytes
std::size_t distinct(void) const
the number of the distinct nonempty palindromes of the string
Definition Palindromes.h:320
Eertree(void)
the eertree of the empty string: the two roots, of length and 0
std::size_t suffixLength(void) const
the length of the longest palindromic suffix of the string
Definition Palindromes.h:325
std::size_t size(void) const
the length of the string
Definition Palindromes.h:330
bool add(unsigned char c)
adds the byte at the end; whether the longest palindromic suffix of the new string occurs there for ...
friend std::vector< std::string > palindromicFactorization(std::string_view s)
the fewest palindromes into which can be cut, in their order, by the series of the eertree,...
S longestPalindromicSubstring(const S &s)
the leftmost of the longest palindromic substrings of
std::vector< S > palindromicPartition(const S &s)
the fewest palindromes into which can be cut, in their order; none for the empty
std::vector< std::string > palindromicFactorization(std::string_view s)
the fewest palindromes into which can be cut, in their order, by the series of the eertree,...
std::pair< std::size_t, std::size_t > longestPalindrome(const S &s)
where a longest palindromic substring of starts and its length, the leftmost one among the longest; ...
S longestPalindromicSubsequence(const S &s)
a longest palindromic subsequence of