13#include <string/LinearString.h>
30 template <
class SymbolType >
35 template <
class SymbolType >
40 long int n = text.size(), m = pat.size();
42 unsigned i = 0 , j = 0 , k = 0 ;
47 while ( j < m && pat[j] == text[
i] ) { ++
i ; ++ j ; }
48 if ( j == m ) { occ.insert(
i - j ) ; continue ; }
50 while (
i <= n - m + j && pat[j] != text[
i] ) ++
i ;
53 while ( k <= m - 1 && pat[k] == text[
i - j + k ] ) ++ k ;
54 if ( k == m ) { occ.insert(
i - j ) ;
i =
i - j + m ; }
57 }
while (
i < n - m + j ) ;
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
static ext::set< unsigned > match(const string::LinearString< SymbolType > &subject, const string::LinearString< SymbolType > &pattern)
Definition: Dogaru.h:36
int i
Definition: AllEpsilonClosure.h:118
void start(measurements::stealth_string name, measurements::Type type)
Definition: measurements.cpp:14
void end()
Definition: measurements.cpp:19
Definition: ArithmeticCompression.h:18