def count_loop
import bend-visgraph@2.0.0.0/src/report.bend as Reportimport Base
63# How many nodes have each degree: `r` is the degree array with the degree
64# of node `i`; the `f` nodes above `i` are still to count.
65def count_loop(f: Nat, r: Array<U32> & U32, +i: U32, c: Array<U32>) -> Array<U32>:
66 match f:
67 case 0n:
68 (d, v) = r
69 bump(c, v)
70 case 1n+q:
71 (d, v) = r
72 count_loop(q, Array.get(U32, d, (i + 1 : U32)), (i + 1 : U32), bump(c, v))