def stops

bend-ml-llama@0.2.1.0 · main.bend:1225

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

1225# whether the draw stops at the head of cs: it is the last kept one (q = 0 kept after it), or the cumulative
1226# weight acc plus its own is above the target u·Zp
1227def stops(cs: List<&2, Cand>, +q: Nat, +temp: F32, +top: F32, +target: F32, +acc: F32) -> Bool:
1228  match cs:
1229    case Nil{}:
1230      True{}
1231    case Con{Cand{+v, i}, t}:
1232      Bool.or(Nat.is_eq(q, 0n), F32.is_lt(target, F32.add(acc, weight(v, temp, top))))

Uses (10)

Used by (4)