def pick_copy

bendtorch@1.3.0.0 · main.bend:2522

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base

2522# t x c numbers of src read from rows r0.. and columns c0.. (src ow wide), written in order into d; idx counts d's cells
2523def pick_copy(left: Nat, +idx: U32, +c: U32, +ow: U32, +oc: U32, d: Array<F32>, r: Array<F32> & F32) -> A2:
2524  match left r:
2525    case 0n Tuple{s, +x}:
2526      A2{s, Array.set(F32, d, idx, x)}
2527    case 1n+n Tuple{s, +x}:
2528      pick_copy(n, (idx + 1 : U32), c, ow, oc, Array.set(F32, d, idx, x), Array.get(F32, s, ((U32.div((idx + 1 : U32), c) * ow : U32) + (oc + U32.mod((idx + 1 : U32), c) : U32) : U32)))

Uses (13)

Used by (1)