def sum_count_atoms

bend-prot@0.1.0.0 · protein.bend:68

import bend-prot@0.1.0.0/protein.bend as Protein
import Base
import bend-prot@0.1.0.0/geom.bend as G

68# Sum positions + count in one pass (list consumed once)
69def sum_count_atoms(xs: List<&2, Atom>) -> G.Vec3 & Nat:
70  match xs:
71    case Nil{}:
72      (G.V3{0.0, 0.0, 0.0}, 0n)
73    case h <> t:
74      sum_count_extend(h, sum_count_atoms(t))

Uses (7)

Used by (3)