ΒΆtemplate <typename T>
unsigned int ComputeEditDistance(
    ArrayRef<T> FromArray,
    ArrayRef<T> ToArray,
    bool AllowReplacements = true,
    unsigned int MaxEditDistance = 0)

Description

Determine the edit distance between two sequences.

Declared at: llvm/include/llvm/ADT/edit_distance.h:42

Templates

T

Parameters

ArrayRef<T> FromArray
the first sequence to compare.
ArrayRef<T> ToArray
the second sequence to compare.
bool AllowReplacements = true
whether to allow element replacements (change one element into another) as a single operation, rather than as two operations (an insertion and a removal).
unsigned int MaxEditDistance = 0
If non-zero, the maximum edit distance that this routine is allowed to compute. If the edit distance will exceed that maximum, returns \c MaxEditDistance+1.

Returns

the minimum number of element insertions, removals, or (if\p AllowReplacements is \c true) replacements needed to transform one of the given sequences into the other. If zero, the sequences are identical.