Searched refs:flat_index (Results 1 – 1 of 1) sorted by relevance
/third_party/rust/crates/strsim-rs/src/ |
D | lib.rs | 315 fn flat_index(i: usize, j: usize, width: usize) -> usize { in flat_index() function 341 distances[flat_index(i + 1, 0, width)] = max_distance; in generic_damerau_levenshtein() 342 distances[flat_index(i + 1, 1, width)] = i; in generic_damerau_levenshtein() 346 distances[flat_index(0, j + 1, width)] = max_distance; in generic_damerau_levenshtein() 347 distances[flat_index(1, j + 1, width)] = j; in generic_damerau_levenshtein() 361 let insertion_cost = distances[flat_index(i, j + 1, width)] + 1; in generic_damerau_levenshtein() 362 let deletion_cost = distances[flat_index(i + 1, j, width)] + 1; in generic_damerau_levenshtein() 363 let transposition_cost = distances[flat_index(k, db, width)] + in generic_damerau_levenshtein() 366 let mut substitution_cost = distances[flat_index(i, j, width)] + 1; in generic_damerau_levenshtein() 372 distances[flat_index(i + 1, j + 1, width)] = min(substitution_cost, in generic_damerau_levenshtein() [all …]
|