Sort.sum.one: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/sort.bend as Sort Lines 112-122 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=112&end_line=122 import Base # Column c, when c < K: over its nb + 1 entries from o + c, step apart # (the groups' last rows, or all the rows of a small table), the total # into cs[c] and os[c], by sum.col. Else 0 into both. def sum.one(lt: Bool, +wr: Bool, +c: U32, +o: U32, +step: U32, +nb: Nat, p: Three) -> Three: match lt: case True{}: Three{t, cs, os} = p sum.put(c, cs, os, sum.col(wr, (o + c : U32), step, nb, t)) case False{}: Three{t, cs, os} = p Three{t, cs[c] <- 0, os[c] <- 0} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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=bend-parallel@0.1.0.0/sort.bend&name=Three https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/sort.bend&name=sum.col https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/sort.bend&name=sum.put