def pdot

bendtorch@1.3.0.0 · spec.bend:143

import bendtorch@1.3.0.0/spec.bend as Spec
import Base
import bendtorch@1.3.0.0/main.bend as T

143# the dot product of two pairs of vectors
144def pdot(a: T.Two<List<&2, Nat>, List<&2, Nat>>, b: T.Two<List<&2, Nat>, List<&2, Nat>>) -> Nat:
145  match a b:
146    case T.Two{a1, a2} T.Two{b1, b2}:
147      Nat.add(dotn(a1, b1), dotn(a2, b2))

Uses (5)

Used by (2)