def search_profiles

bend-edit-distance@0.2.2.0 · src/Myers.bend:420

import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers
import Base
import bend-edit-distance@0.2.2.0/EdlibTypes.bend as E

420def search_profiles(target: String, profiles: List<&2, Peq>, +length: Nat,
421                    +target_length: Nat, threshold: E.Threshold) -> Search:
422  match threshold:
423    case E.MaxDistance{maximum}:
424      band_attempt(target, profiles, length, target_length, Nat.min(maximum, target_length),
425        Nat.sub(Nat.mul(ceil_div(length, 32n), 32n), length))
426    case E.Unlimited{}:
427      adaptive_search(1n+target_length, target, profiles, length, target_length,
428        Nat.min(target_length, Nat.max(32n, Nat.sub(target_length, length))),
429        Nat.sub(Nat.mul(ceil_div(length, 32n), 32n), length), 0n, 0n, 0n)

Uses (13)

Used by (1)