9#include <string/LinearString.h>
25 template<
class SymbolType>
28 std::stack < StateType > &
stack )
30 for (
const auto & symb :
result.getInputAlphabet() )
33 for (
const auto & n :
node )
36 for (
const auto & it : transitionsOnSymb )
37 newNode.insert( it.second );
39 if ( ! newNode.empty() )
41 result.addState( newNode );
43 stack.push( newNode );
57 template<
class SymbolType>
69 std::stack < StateType >
stack;
70 stack.push( initialState );
73 while ( !
stack.empty() )
78 if (
std::any_of(
node.begin(),
node.end(), [&] (
auto x ) { return ndSuffixAutomaton.getFinalStates().find( x ) != ndSuffixAutomaton.getFinalStates().end(); } ) )
Deterministic finite automaton. Accepts regular languages.
Definition: DFA.h:71
Nondeterministic finite automaton. Accepts regular languages.
Definition: NFA.h:66
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
auto equal_range(K &&key) const &
Make range of elements with key equal to the key.
Definition: set.hpp:200
Linear string.
Definition: LinearString.h:57
const ext::set< SymbolType > & getAlphabet() const &
Definition: LinearString.h:103
static automaton::NFA< SymbolType, ext::pair< unsigned int, unsigned int > > construct(const string::LinearString< SymbolType > &pattern, unsigned int k)
Definition: NondeterministicApproximateSuffixAutomatonForHammingDistance.h:24
Definition: DeterministicApproximateSuffixAutomatonForHammingDistanceFactory.h:21
static automaton::DFA< SymbolType, StateType > construct(const string::LinearString< SymbolType > &pattern, unsigned k)
Definition: DeterministicApproximateSuffixAutomatonForHammingDistanceFactory.h:58
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
any_of(T &&...) -> any_of< T... >
Definition: ApproximateSeedComputation.cpp:10