9#include <string/LinearString.h>
32 template <
class SymbolType >
36template <
class SymbolType >
41 if ( ! std::get < 0 > ( run ) )
44 std::deque < std::pair < unsigned, unsigned > > open = { { std::get < 1 > ( run ), 0u } };
46 while ( ! open.empty ( ) ) {
47 std::pair < unsigned, unsigned > cur = std::move ( open.back ( ) );
50 if ( suffixAutomaton.
getAutomaton ( ).getFinalStates ( ).count ( cur.first ) )
51 tmp.push_back ( cur.second );
53 for (
const auto & transition : suffixAutomaton.
getAutomaton ( ).getTransitionsFromState ( cur.first ) )
54 open.emplace_back ( transition.second, cur.second + 1 );
58 for (
unsigned dist : tmp )
59 res.insert ( backboneLength - dist -
string.getContent ( ).size ( ) );
Class extending the tuple class from the standard library. Original reason is to allow printing of th...
Definition: tuple.hpp:42
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Suffix automaton string index. Automaton representation of all suffixes. The automaton is general det...
Definition: SuffixAutomaton.h:50
unsigned getBackboneLength() const
Definition: SuffixAutomaton.h:116
const automaton::DFA< SymbolType, unsigned > & getAutomaton() const &
Definition: SuffixAutomaton.h:175
Linear string.
Definition: LinearString.h:57
Definition: SuffixAutomatonFactors.h:24
static ext::set< unsigned > query(const indexes::stringology::SuffixAutomaton< SymbolType > &suffixAutomaton, const string::LinearString< SymbolType > &string)
Definition: SuffixAutomatonFactors.h:37
return res
Definition: MinimizeByPartitioning.h:145
Definition: ArithmeticCompression.h:18