9#include <string/LinearString.h>
31 template <
class SymbolType >
36template <
class SymbolType >
41 size_t patternLength = pattern.
getData ( ).begin ( )->second.size ( );
42 size_t subjectLength = subject.
getContent ( ).size ( );
43 size_t posInSubject = 0;
46 currentBitmask.resize ( patternLength );
48 while ( posInSubject + patternLength <= subjectLength ) {
49 size_t posInPattern = patternLength;
50 size_t lastPosOfFactor = patternLength;
55 while ( posInPattern > 0 &&
ext::any ( currentBitmask ) ) {
57 if ( symbolVectorIter == pattern.
getData ( ).end ( ) )
60 currentBitmask &= symbolVectorIter->second;
64 if ( currentBitmask [ patternLength - 1 ] ) {
66 if ( posInPattern > 0 )
67 lastPosOfFactor = posInPattern;
70 occ.insert ( posInSubject );
76 posInSubject += lastPosOfFactor;
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Bit parallel string index. Stores a bit vector for each symbol of the alphabet. The bit vector of sym...
Definition: BitParallelIndex.h:51
const ext::map< SymbolType, ext::vector< bool > > & getData() const &
Definition: BitParallelIndex.h:170
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
Definition: WideBNDMOccurrences.h:23
static ext::set< unsigned > query(const indexes::stringology::BitParallelIndex< SymbolType > &pattern, const string::LinearString< SymbolType > &subject)
Definition: WideBNDMOccurrences.h:37
void fill(ext::vector< bool, Ts ... > &v)
Sets all bits in the vector of booleans.
Definition: vector.hpp:852
bool any(const ext::vector< bool, Ts ... > &v)
Tests the vector of booleans whether at least one bit inside is set.
Definition: vector.hpp:820
Definition: ArithmeticCompression.h:18