def by_source

bend-visgraph@2.0.0.0 · visgraph.bend:954

import bend-visgraph@2.0.0.0/visgraph.bend as Visgraph
import Base

954# The half edges from position `p` on, in target order, into their
955# sources' rows.
956def by_source(count: Nat, +p: U32, ur: Array<U32> & U32, vr: Array<U32> & U32, wr: Array<F32> & F32, out: Rows) -> Rows:
957  match count:
958    case 0n:
959      (us, u) = ur
960      (vs, v) = vr
961      (ws, w) = wr
962      out
963    case 1n+k:
964      (us, +u) = ur
965      (vs, +v) = vr
966      (ws, +w) = wr
967      Rows{cur, targets, weights} = out
968      +p2 = (p + 1 : U32)
969      by_source(k, p2, Array.get(U32, us, p2), Array.get(U32, vs, p2), Array.get(F32, ws, p2), put_row(u, v, w, Array.get(U32, cur, u), targets, weights))

Uses (10)

Used by (1)