9#include <string/LinearString.h>
23 template <
class SymbolType >
33 template <
class SymbolType >
37template <
class SymbolType >
39 const auto& x =
string.getContent();
40 size_t i = 0, j = 1, k = 1, p = 1;
42 while (j + k <= x.size()) {
43 auto A = x[
i + k - 1];
44 auto a = x[j + k - 1];
45 if ( a < A ) { j = j + k ; k = 1 ; p = j -
i ; }
47 if ( k == p ) { j = j + p ; k = 1 ; }
else { k = k + 1 ;}
48 }
else {
i = j ; j =
i + 1 ; k = 1 ; p = 1 ;}
53template <
class SymbolType >
55 const auto& x =
string.getContent();
56 size_t i = 0, j = 1, k = 1, p = 1;
58 while (j + k <= x.size()) {
59 auto A = x[
i + k - 1];
60 auto a = x[j + k - 1];
61 if ( a > A ) { j = j + k ; k = 1 ; p = j -
i ; }
63 if ( k == p ) { j = j + p ; k = 1 ; }
else { k = k + 1 ;}
64 }
else {
i = j ; j =
i + 1 ; k = 1 ; p = 1 ;}
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Linear string.
Definition: LinearString.h:57
Definition: MaximalSuffix.h:15
static ext::pair< size_t, size_t > constructReversed(const string::LinearString< SymbolType > &string)
Definition: MaximalSuffix.h:54
static ext::pair< size_t, size_t > construct(const string::LinearString< SymbolType > &string)
Definition: MaximalSuffix.h:38
int i
Definition: AllEpsilonClosure.h:118
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: RandomStringFactory.cpp:12