Determine the edit distance between two sequences.
Declared in <llvm/ADT/edit_distance.h>
template<typename T>
unsigned int
ComputeEditDistance(
ArrayRef<T> FromArray,
ArrayRef<T> ToArray,
bool AllowReplacements = true,
unsigned int MaxEditDistance = 0);
This is a convenience wrapper around ComputeMappedEditDistance that compares elements directly without applying a mapping functor.
The minimum number of element insertions, removals, or (if AllowReplacements is true) replacements needed to transform one of the given sequences into the other. If zero, the sequences are identical.
| Name | Description |
|---|---|
| FromArray | The first sequence to compare. |
| ToArray | The second sequence to compare. |
| AllowReplacements | Whether to allow element replacements (change one element into another) as a single operation, rather than as two operations (an insertion and a removal). |
| MaxEditDistance | If non-zero, the maximum edit distance that this routine is allowed to compute. If the edit distance will exceed that maximum, returns MaxEditDistance+1. |