def cols
bend-parallel@0.1.0.0 · histogram.bend:268
import bend-parallel@0.1.0.0/histogram.bend as Histogram
import Base
268
269
270
271
272def cols(+d: Nat, +j: U32, +w: Nat, +k: U32, +o: U32, +step: U32, +nb: Nat, ft: Array<U32> & Array<U32>, fc: Array<U32> & Array<U32>) -> Two:
273 match d:
274 case 0n:
275 (t, t2) = ft
276 (cs, cs2) = fc
277 two.rejoin(t2, cs2, cols.go(U32.to_nat((U32.shln(1, w) - 1 : U32)), U32.shln(j, w), k, o, step, nb, Two{t, cs}))
278 case 1n+p:
279 (t0, t1) = ft
280 (c0, c1) = fc
281 +i = (j * 2 : U32)
282 l r = cols(p, i, w, k, o, step, nb, Array.fork(U32, t0), Array.fork(U32, c0))
283 cols(p, (i + 1 : U32), w, k, o, step, nb, Array.fork(U32, t1), Array.fork(U32, c1))
284 two.join(l, r)