def tree
bend-visgraph@2.0.0.0 · parallel.bend:125
import bend-visgraph@2.0.0.0/parallel.bend as Parallel
import Base
import bend-visgraph@2.0.0.0/visgraph.bend as VG
125def tree(depth: Nat, h: Halves, cc: VG.Cols & VG.Cols, xx: Array<F32> & Array<F32>, +index: Bool, +g: VG.Visibility, +dir: VG.Direction, +k: VG.Weight, +lo: F32, +hi: F32) -> VG.Edges:
126 match depth h:
127 case 1n++d Halves{a, +na, b, +nb}:
128 (c1, c2) = cc
129 (x1, x2) = xx
130 x y = tree(d, halves(a, na), fork_cols(c1), Array.fork(F32, x1), index, g, dir, k, lo, hi) tree(d, halves(b, nb), fork_cols(c2), Array.fork(F32, x2), index, g, dir, k, lo, hi)
131 VG.EJoin{x, y}
132 case _ Halves{a, na, b, nb}:
133 (c1, c2) = cc
134 (x1, x2) = xx
135 x y = leaf(a, c1, x1, index, g, dir, k, lo, hi) leaf(b, c2, x2, index, g, dir, k, lo, hi)
136 VG.EJoin{x, y}