def grp.one

bend-parallel@0.1.0.0 · histogram.bend:198

import bend-parallel@0.1.0.0/histogram.bend as Histogram
import Base

198# Column c of a group (rows from top, nm + 1 of them, step apart), when
199# c < K: sc, each entry becomes the group's sum through it; else the sum
200# goes into the last row (at last).
201def grp.one(lt: Bool, +sc: Bool, +c: U32, +top: U32, +last: U32, +step: U32, +nm: Nat, t: Array<U32>) -> Array<U32>:
202  match lt:
203    case True{}:
204      match sc:
205        case True{}:
206          ins.go(nm, (top + c : U32), step, 0, t[(top + c : U32)])
207        case False{}:
208          grp.put((last + c : U32), col.go(nm, (top + c : U32), step, 0, t[(top + c : U32)]))
209    case False{}:
210      t

Uses (9)

Used by (1)