dotNat as recursive equations, the compiled implementation.
Equations
- Hex.Matrix.Packed.dotNatImpl (a :: as) (b :: bs) = (a.mul b).add (Hex.Matrix.Packed.dotNatImpl as bs)
- Hex.Matrix.Packed.dotNatImpl x✝¹ x✝ = 0
Instances For
The dot product of two natural-number lists, stopping at the shorter.
List.rec is applied directly instead of recursive equations elaborated
through List.brecOn, whose below tuple the kernel would build and
project at every term; noncomputable only suppresses compilation, and
dotNat_eq_impl gives the compiler the equation form.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A row packed into one number with W-bit slots: Σ aₖ · 2^(W·k).
Equations
- Hex.Matrix.Packed.packRow W [] = 0
- Hex.Matrix.Packed.packRow W (a :: as) = a.add ((Hex.Matrix.Packed.packRow W as).shiftLeft W)
Instances For
The rows packed.
Equations
Instances For
Horner accumulation of k more slots from the front of a list, missing
entries read as 0: after k steps from acc, the entries consumed sit in
reverse order below acc.
Equations
- Hex.Matrix.Packed.packRevAux W 0 x✝¹ x✝ = x✝¹
- Hex.Matrix.Packed.packRevAux W k.succ x✝ [] = Hex.Matrix.Packed.packRevAux W k (x✝.shiftLeft W) []
- Hex.Matrix.Packed.packRevAux W k.succ x✝ (a :: as) = Hex.Matrix.Packed.packRevAux W k ((x✝.shiftLeft W).add a) as
Instances For
A column of vt cut or zero-padded to r entries and packed in reverse
order, in r steps.
Equations
- Hex.Matrix.Packed.packCol W r c = Hex.Matrix.Packed.packRevAux W r 0 c
Instances For
The columns packed.
Equations
- Hex.Matrix.Packed.packCols W r [] = []
- Hex.Matrix.Packed.packCols W r (r_1 :: rs) = Hex.Matrix.Packed.packCol W r r_1 :: Hex.Matrix.Packed.packCols W r rs
Instances For
Slot r − 1 of p: bits W·(r − 1), …, W·r − 1.
Equations
- Hex.Matrix.Packed.slot W r p = (p.shiftRight (W.mul (r - 1))).land ((Nat.pow 2 W).sub 1)
Instances For
The dot product of a packed row and a reverse-packed column of r
entries.
Equations
- Hex.Matrix.Packed.dotPacked W r pb pc = Hex.Matrix.Packed.slot W r (pb.mul pc)
Instances For
dotInt as recursive equations, the compiled implementation.
Equations
- Hex.Matrix.Packed.dotIntImpl (a :: as) (b :: bs) = (a.mul b).add (Hex.Matrix.Packed.dotIntImpl as bs)
- Hex.Matrix.Packed.dotIntImpl x✝¹ x✝ = 0
Instances For
A row prepended entrywise to a list of columns: entry j of the row goes
on top of column j; a short row contributes 0s, and entries past the
last column are dropped.
Equations
- Hex.Matrix.Packed.consCols (a :: as) (c :: cs) = (a :: c) :: Hex.Matrix.Packed.consCols as cs
- Hex.Matrix.Packed.consCols [] (c :: cs) = (0 :: c) :: Hex.Matrix.Packed.consCols [] cs
- Hex.Matrix.Packed.consCols x✝ [] = []
Instances For
m empty columns.
Equations
Instances For
The m columns of a row list, built in one pass over the rows: n · m
list steps, against the n · m indexed reads of O(index) each that
column would cost.
Equations
Instances For
The nonnegative parts of a signed row.
Equations
Instances For
The nonpositive parts of a signed row, negated.
Equations
Instances For
Every entry has absolute value below k.
Equations
- Hex.Matrix.Packed.allAbsLt k [] = true
- Hex.Matrix.Packed.allAbsLt k (a :: as) = (a.natAbs.blt k && Hex.Matrix.Packed.allAbsLt k as)
Instances For
Every entry of every row has absolute value below k.
Equations
Instances For
A list cut or zero-padded to r entries and packed in order.
Equations
- Hex.Matrix.Packed.packCut W r l = Hex.Matrix.Packed.packRow W (List.take r l ++ List.replicate (r - l.length) 0)
Instances For
A signed row cut or zero-padded to r entries, packed as its two parts.
Equations
Instances For
The rows so packed.
Equations
- Hex.Matrix.Packed.packSignedRows W r [] = []
- Hex.Matrix.Packed.packSignedRows W r (r_1 :: rs) = Hex.Matrix.Packed.packSignedCut W r r_1 :: Hex.Matrix.Packed.packSignedRows W r rs
Instances For
A signed column cut or zero-padded to r entries, reverse-packed as its
two parts.
Equations
Instances For
The columns so packed.
Equations
- Hex.Matrix.Packed.packSignedCols W r [] = []
- Hex.Matrix.Packed.packSignedCols W r (r_1 :: rs) = Hex.Matrix.Packed.packSignedCol W r r_1 :: Hex.Matrix.Packed.packSignedCols W r rs