def put.go

bend-parallel@0.1.0.0 · sort.bend:299

import bend-parallel@0.1.0.0/sort.bend as Sort
import Base
import bend-parallel@0.1.0.0/histogram.bend as Hist

299# r holds the keys and the key x read at j: key j goes to the next slot
300# of its bucket in the row at row, then the n keys after j. k1 is K - 1.
301def put.go(+n: Nat, +j: U32, +row: U32, +k1: U32, p: Hist.Two, r: Array<U32> & U32) -> Three:
302  match n:
303    case 0n:
304      (ks, +x) = r
305      put.fin(ks, put.one(j, (row + U32.min(x, k1) : U32), p))
306    case 1n+q:
307      (ks, +x) = r
308      +i = (j + 1 : U32)
309      put.go(q, i, row, k1, put.one(j, (row + U32.min(x, k1) : U32), p), ks[i])

Uses (12)

Used by (1)