EventAnalysis
1.3.0
|
Functions | |
template<typename Iterator1 , typename Iterator2 > | |
std::size_t | levenshtein (Iterator1 a, Iterator1 aEnd, Iterator2 b, Iterator2 bEnd) |
template<typename Container1 , typename Container2 > | |
std::size_t | levenshtein (const Container1 &a, const Container2 &b) |
template<typename T , typename Iterator1 , typename Iterator2 > | |
T | levenshteinDiagonal (Iterator1 a, Iterator1 aEnd, Iterator2 b, Iterator2 bEnd) |
template<typename T , typename Iterator1 , typename Iterator2 > | |
T | levenshteinRowBased (Iterator1 a, Iterator1 aEnd, Iterator2 b, Iterator2 bEnd) |
template<typename Iterator1 , typename Iterator2 > | |
std::size_t | levenshtein (Iterator1 a, Iterator1 aEnd, Iterator2 b, Iterator2 bEnd, std::random_access_iterator_tag, std::random_access_iterator_tag) |
template<typename Iterator1 , typename Iterator2 > | |
std::size_t | levenshtein (Iterator1 a, Iterator1 aEnd, Iterator2 b, Iterator2 bEnd, std::bidirectional_iterator_tag, std::bidirectional_iterator_tag) |
Variables | |
constexpr std::size_t | alignment = 1 |
The MIT License (MIT)
Copyright (c) 2016 Anna Henningsen sqrt@ entl ess.o rg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
std::size_t levenshteinSSE::levenshtein | ( | Iterator1 | a, |
Iterator1 | aEnd, | ||
Iterator2 | b, | ||
Iterator2 | bEnd | ||
) |
Public methods Compute the Levenshtein distances of [a, aEnd) and [b, bEnd). Both types of iterators need to be bidirectional, e.g. fulfill the requirements of BidirectionalIterator, but may just be pointers.
For pointers to types where SIMD instructions make sense, these are used when available.
std::size_t levenshteinSSE::levenshtein | ( | const Container1 & | a, |
const Container2 & | b | ||
) |
Compute the Levenshtein distances of a and b. Both containers need to support bidirectional start and end iterators (via std::begin() and std::end()).
If both containers provide .data() and .size(), these are used to get pointers to the start and past-end elements. This holds true for std::string, std::vector, std::array and possibly more, but if you want to use this with custom container types, bear in mind that this also means that the available memory area needs to be contiguous.
std::size_t levenshteinSSE::levenshtein | ( | Iterator1 | a, |
Iterator1 | aEnd, | ||
Iterator2 | b, | ||
Iterator2 | bEnd, | ||
std::random_access_iterator_tag | , | ||
std::random_access_iterator_tag | |||
) |
Preable for edge cases and skipping common prefixes/suffixes, random access version.
std::size_t levenshteinSSE::levenshtein | ( | Iterator1 | a, |
Iterator1 | aEnd, | ||
Iterator2 | b, | ||
Iterator2 | bEnd, | ||
std::bidirectional_iterator_tag | , | ||
std::bidirectional_iterator_tag | |||
) |
Preable for edge cases and skipping common prefixes/suffixes, non-random access version.
T levenshteinSSE::levenshteinDiagonal | ( | Iterator1 | a, |
Iterator1 | aEnd, | ||
Iterator2 | b, | ||
Iterator2 | bEnd | ||
) |
Outer loop of the diagonal algorithm variant.
T levenshteinSSE::levenshteinRowBased | ( | Iterator1 | a, |
Iterator1 | aEnd, | ||
Iterator2 | b, | ||
Iterator2 | bEnd | ||
) |
Outer loop of the row-based variant, used for non-random-access iterators.
constexpr std::size_t levenshteinSSE::alignment = 1 |