src/DistanceDP.bend checks
raw source on the hub · import bend-edit-distance@0.2.2.0/src/DistanceDP.bend as DistanceDP
2 imports
import Base import ../EdlibTypes.bend as E
Types
type Best source · line 110 · raw
Data
Best@score:U32 -> @ends:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Coordinate> -> Best
Definitions
def initial_row source · line 9 · raw
@length:Nat -> @+column:U32 -> List<&1, U32>
def cell source · line 18 · raw
@above:U32 -> @left:U32 -> @diagonal:U32 -> @row_symbol:Char -> @column_symbol:Char -> @pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> U32
D[i,j] = min(D[i-1,j] + 1, D[i,j-1] + 1, D[i-1,j-1] + !equal(pairs, row_symbol, column_symbol)).
def row_cells source · line 26 · raw
@columns:String -> @previous:List<&1, U32> -> @diagonal:U32 -> @left:U32 -> @+symbol:Char -> @+pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> List<&1, U32>
Consume the old row as the new row is built. The left/diagonal dependency makes adjacent cells sequential; copying a full matrix is unnecessary.
def next_row source · line 37 · raw
@previous:List<&1, U32> -> @columns:String -> @symbol:Char -> @+index:U32 -> @pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> List<&1, U32>
def last_cell source · line 45 · raw
@row:List<&1, U32> -> Nat
def rows source · line 54 · raw
@sequence:String -> @+columns:String -> @previous:List<&1, U32> -> @+index:U32 -> @+pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> Nat
def distance_shorter source · line 62 · raw
@query:String -> @target:String -> @query_length:Nat -> @target_length:Nat -> @query_is_shorter:Bool -> @pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> Nat
def distance_with_equalities source · line 72 · raw
@query:String -> @target:String -> @pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> Nat
Public entry point: importing this module does not import or call Myers.
def distance source · line 85 · raw
@query:String -> @target:String -> Nat
def initial_semiglobal_row source · line 91 · raw
@length:Nat -> @+column:U32 -> @+mode:0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Mode -> List<&1, U32>
Directional DP keeps query rows and target columns in their original order. D[i,0] = i in every mode. SHW has D[0,j] = j and a free target suffix; HW has D[0,j] = 0 and both target ends free. Both minimize D[m,j].
def final_row source · line 102 · raw
@query:String -> @+target:String -> @previous:List<&1, U32> -> @+index:U32 -> @+pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> List<&1, U32>
def collect_best source · line 113 · raw
@best:Best -> @score:U32 -> @end:0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Coordinate -> @comparison:Cmp -> Best
def collect source · line 122 · raw
@cells:List<&1, U32> -> @+index:Nat -> @+best:Best -> Best
def semiglobal_endpoints source · line 130 · raw
@cells:List<&1, U32> -> @include_before:Bool -> Best
def semiglobal source · line 139 · raw
@+query:String -> @+target:String -> @mode:0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Mode -> @pairs:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.EqualityPair> -> Best
def semiglobal_result.accept source · line 146 · raw
@score:U32 -> @ends:List<&2, 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Coordinate> -> @accepted:Bool -> 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.AlignResult
def semiglobal_result source · line 153 · raw
@best:Best -> @+threshold:0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.Threshold -> 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.AlignResult
def align source · line 160 · raw
@query:String -> @target:String -> @config:0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.AlignConfig -> 0xd65851cd1dee629f72e346cda168bc1d/EdlibTypes.AlignResult
The independent worker supports configured DISTANCE in every mode, including Edlib's empty-input early return before threshold filtering.