def pick.go

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

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

1234# the candidate drawn; s: whether it is the head of cs
1235def pick.go(cs: List<&2, Cand>, s: Bool, +q: Nat, +temp: F32, +top: F32, +target: F32, +acc: F32) -> Cand:
1236  match cs s:
1237    case Nil{} _:
1238      Cand{0.0, 0n}
1239    case Con{h, t} True{}:
1240      h
1241    case Con{Cand{+v, i}, +t} False{}:
1242      +acc2 = F32.add(acc, weight(v, temp, top))
1243      pick.go(t, stops(t, Nat.sub(q, 1n), temp, top, target, acc2), Nat.sub(q, 1n), temp, top, target, acc2)

Uses (9)

Used by (2)