Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
BNDMMatcherConstruction.h
Go to the documentation of this file.
1
6#pragma once
7
9#include <string/LinearString.h>
11
12namespace stringology {
13
14namespace matching {
15
22public:
28 template < class SymbolType, size_t BitmaskBitCount = 64 >
30
31};
32
33template < class SymbolType, size_t BitmaskBitCount >
35 size_t bitmaskLength = std::min ( w.getContent ( ).size ( ), BitmaskBitCount );
36
38 for ( const SymbolType & symbol : w.getAlphabet ( ) )
39 res [ symbol ] = ext::bitset < BitmaskBitCount > ( 0 );
40
41 for ( unsigned i = 0; i < bitmaskLength; ++i )
42 res [ w.getContent ( ) [ i ] ] [ bitmaskLength - i - 1 ] = true;
43
45}
46
47} /* namespace matching */
48
49} /* namespace stringology */
50
Class extending the bitset class from the standard library. Original reason is to allow printing of t...
Definition: bitset.hpp:42
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Bit set string index. Stores a bit set for each symbol of the alphabet. The bit set of symbol a conta...
Definition: BitSetIndex.h:54
Linear string.
Definition: LinearString.h:57
const ext::set< SymbolType > & getAlphabet() const &
Definition: LinearString.h:103
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
Definition: BNDMMatcherConstruction.h:21
static indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount > construct(const string::LinearString< SymbolType > &w)
Definition: BNDMMatcherConstruction.h:34
int i
Definition: AllEpsilonClosure.h:118
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
constexpr const T & min(const T &a)
Definition: algorithm.hpp:310
Definition: ArithmeticCompression.h:18