Sort.fwds: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/sort.bend as Sort Lines 265-280 of bend-parallel@0.1.0.0/sort.bend: https://jend.leeeet.dev/read.txt?path=bend-parallel@0.1.0.0/sort.bend&start_line=265&end_line=280 import Base import bend-parallel@0.1.0.0/histogram.bend as Hist # The forks, shaped as pass 2b's, with two handles each to the table and # the offsets. Group j reads only its own offsets and reads and writes # only its columns of the table. def fwds(+d: Nat, +j: U32, +w: Nat, +k: U32, +kb: Nat, +nb: Nat, ft: Array & Array, fo: Array & Array) -> Hist.Two: match d: case 0n: (t, t2) = ft (os, os2) = fo Hist.two.rejoin(t2, os2, fwd.cols(U32.to_nat((U32.shln(1, w) - 1 : U32)), U32.shln(j, w), k, kb, nb, Hist.Two{t, os})) case 1n+p: (t0, t1) = ft (o0, o1) = fo +i = (j * 2 : U32) l r = fwds(p, i, w, k, kb, nb, Array.fork(U32, t0), Array.fork(U32, o0)) fwds(p, (i + 1 : U32), w, k, kb, nb, Array.fork(U32, t1), Array.fork(U32, o1)) Hist.two.join(l, r) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.fork https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/histogram.bend&name=Two https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/histogram.bend&name=two.join https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/histogram.bend&name=two.rejoin https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/sort.bend&name=fwd.cols