def contacts_between

bend-prot@0.1.0.0 · topology.bend:90

import bend-prot@0.1.0.0/topology.bend as Topology
import Base
import bend-prot@0.1.0.0/protein.bend as P

90# Interface size: pairs (x in xs, y in ys) with dist2 < c2. Consumes xs once;
91# ys is reusable so every head reuses it (reference counted).
92def contacts_between(xs: List<&2, P.Atom>, +ys: List<&2, P.Atom>, +c2: F32) -> Nat:
93  match xs:
94    case Nil{}:
95      0n
96    case h <> t:
97      Nat.add(contacts_between(t, ys, c2), contacts_of_head(h, ys, c2))

Uses (6)

Used by (3)