9#include <string/LinearString.h>
23 template <
class SymbolType >
29 template <
class SymbolType>
31 for (
size_t per = 1 ; per <= prefixLen/2 ; ++ per ){
33 for (
size_t i = per ;
i < prefixLen ; ++
i ) {
34 if ( x[
i] != x[
i - per] ){ hasPer = false ; break ; }
36 if ( hasPer )
return per ;
42template <
class SymbolType >
44 const auto& x =
string.getContent();
46 ssize_t maxlen = -1 , maxper = -1 ;
47 for (
size_t i = 1 ;
i <= x.size() ; ++
i ) {
48 auto per = hasShortPeriod(x ,
i) ;
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Linear string.
Definition: LinearString.h:57
Definition: PeriodicPrefix.h:15
static ext::pair< ssize_t, ssize_t > construct(const string::LinearString< SymbolType > &string)
Definition: PeriodicPrefix.h:43
int i
Definition: AllEpsilonClosure.h:118
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: RandomStringFactory.cpp:12