Myers.hw_locations: def of bend-edit-distance@0.2.2.0 Import: import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers Lines 607-627 of bend-edit-distance@0.2.2.0/src/Myers.bend: https://jend.leeeet.dev/read.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&start_line=607&end_line=627 import Base import bend-edit-distance@0.2.2.0/src/Alignment.bend as A # Independent starts share one reversed query profile. Split their searches # into balanced parallel branches, then concatenate in the original end order. def hw_locations(fuel: Nat, locations: List<&2, A.Location>, +reverse_target: String, +target_length: Nat, +profiles: List<&2, Peq>, +query_length: Nat, +maximum: Nat) -> List<&2, A.Location>: match fuel locations: case 0n _: locations case 1n+p Nil{}: Nil{} case 1n+p location <> Nil{}: [hw_location(location, reverse_target, target_length, profiles, query_length, maximum)] case Succ{+p} +values: +half = Nat.div(List.length(&2, A.Location, values), 2n) left right = hw_locations(p, List.take(&2, A.Location, values, half), reverse_target, target_length, profiles, query_length, maximum) hw_locations(p, List.drop(&2, A.Location, values, half), reverse_target, target_length, profiles, query_length, maximum) List.append(&2, A.Location, left, right) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.take https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Alignment.bend&name=Location https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=Peq https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&name=hw_location