KompareDiff2::LevenshteinTable Class

template <typename SequencePair> class KompareDiff2::LevenshteinTable

Computes the Levenshtein distance between two sequences. More...

Header: #include <LevenshteinTable>
CMake: find_package(KompareDiff2 REQUIRED)
target_link_libraries(mytarget PRIVATE KompareDiff2::KompareDiff2)

Public Functions

LevenshteinTable()
LevenshteinTable(unsigned int width, unsigned int height)
~LevenshteinTable()
int chooseRoute(int c1, int c2, int c3, int current)
void createListsOfMarkers()
unsigned int createTable(SequencePair *sequences)
void dumpLevenshteinTable()
int getContent(unsigned int posX, unsigned int posY) const
unsigned int height() const
int setContent(unsigned int posX, unsigned int posY, int value)
bool setSize(unsigned int width, unsigned int height)
unsigned int width() const

Detailed Description

The actual sequence contents must be prepended with one virtual item each for easier index access.

Member Function Documentation

LevenshteinTable::LevenshteinTable()

LevenshteinTable::LevenshteinTable(unsigned int width, unsigned int height)

LevenshteinTable::~LevenshteinTable()

int LevenshteinTable::chooseRoute(int c1, int c2, int c3, int current)

void LevenshteinTable::createListsOfMarkers()

unsigned int LevenshteinTable::createTable(SequencePair *sequences)

This calculates the levenshtein distance of 2 sequences. This object takes ownership of the argument

void LevenshteinTable::dumpLevenshteinTable()

Debug method to check if the table is properly filled

int LevenshteinTable::getContent(unsigned int posX, unsigned int posY) const

unsigned int LevenshteinTable::height() const

int LevenshteinTable::setContent(unsigned int posX, unsigned int posY, int value)

bool LevenshteinTable::setSize(unsigned int width, unsigned int height)

unsigned int LevenshteinTable::width() const