11#include <string/LinearString.h>
15namespace simulations {
19 template <
class SymbolType>
22 template <
class SymbolType>
26template <
class SymbolType>
34 for(
unsigned int j = 0; j <= pattern.
getContent().size(); j++) {
39 for(
unsigned int j = 1; j<=pattern.
getContent().size(); j++) {
42 value_a = table[j-1][
i-1];
44 value_a = table[j-1][
i-1] + 1;
47 unsigned int value_b = UINT_MAX;
49 value_b = table[j][
i-1] + 1;
52 value_b =
std::min(table[j-1][
i] + 1, value_b);
54 unsigned int value_c = UINT_MAX;
56 value_c = table[j-2][
i-2] + 1;
59 table[j][
i] =
std::min({value_a, value_b, value_c});
66template <
class SymbolType>
73 if(table[pattern.
getContent().size()][
i] <= errors) {
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Linear string.
Definition: LinearString.h:57
const ext::vector< SymbolType > & getContent() const &
Definition: LinearString.h:238
Definition: GeneralizedLevenshteinDynamicProgramming.h:17
static ext::vector< ext::vector< unsigned int > > compute_table(const string::LinearString< SymbolType > &text, const string::LinearString< SymbolType > &pattern)
Definition: GeneralizedLevenshteinDynamicProgramming.h:27
static ext::set< unsigned int > search(const string::LinearString< SymbolType > &text, const string::LinearString< SymbolType > &pattern, unsigned int errors)
Definition: GeneralizedLevenshteinDynamicProgramming.h:67
int i
Definition: AllEpsilonClosure.h:118
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
constexpr const T & min(const T &a)
Definition: algorithm.hpp:310
Definition: ArithmeticCompression.h:18