def estimate_sizes

bend-edit-distance@0.2.2.0 · src/Batch.bend:53

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

53# A scheduling heuristic, not a timing prediction: input scans, 256-symbol
54# profiles, full Myers columns, worst-case HW start searches and PATH DP.
55# F32 avoids wrapping a U32 product or allocating a quadratic unary Nat.
56# Bands, retries, similarity and the selected interval can change actual work.
57def estimate_sizes(qn: Nat, tn: Nat, config: E.AlignConfig) -> F32:
58  match qn tn config:
59    case 0n +t _:
60      (1.0 + F32.from_nat(t) : F32)
61    case +q 0n _:
62      (1.0 + F32.from_nat(q) : F32)
63    case +q +t E.AlignConfig{+mode, task, _, pairs, _}:
64      estimate_axes(mode, task, pairs, axes(mode, q, t))

Uses (7)

Used by (1)