Check a predicate at every index below a natural bound.
Equations
- Hex.Matrix.Lists.all p 0 = true
- Hex.Matrix.Lists.all p n.succ = (Hex.Matrix.Lists.all p n && p n)
Instances For
List lookup with an explicit default and structural recursion.
Equations
- Hex.Matrix.Lists.entry zero [] x✝ = zero
- Hex.Matrix.Lists.entry zero (x_2 :: tail) 0 = x_2
- Hex.Matrix.Lists.entry zero (head :: xs) n.succ = Hex.Matrix.Lists.entry zero xs n
Instances For
Integer entry of a row list, padded with zeros.
Equations
- Hex.Matrix.Lists.get rows i j = Hex.Matrix.Lists.entry 0 (Hex.Matrix.Lists.entry [] rows i) j
Instances For
A structurally recursive integer dot product.
Equations
- Hex.Matrix.Lists.dot (a :: as) (b :: bs) = (a.mul b).add (Hex.Matrix.Lists.dot as bs)
- Hex.Matrix.Lists.dot x✝¹ x✝ = 0
Instances For
A column of a row list.
Equations
- Hex.Matrix.Lists.column j [] = []
- Hex.Matrix.Lists.column j (row :: rows) = Hex.Matrix.Lists.entry 0 row j :: Hex.Matrix.Lists.column j rows
Instances For
The entry function for a rectangular diagonal matrix.
Equations
- Hex.Matrix.Lists.diagonal d i j = if i.beq j = true then Hex.Matrix.Lists.entry 0 d i else 0
Instances For
Exact unnormalized integer coefficient addition.
Equations
- Hex.Matrix.Lists.add [] x✝ = x✝
- Hex.Matrix.Lists.add x✝ [] = x✝
- Hex.Matrix.Lists.add (x_2 :: xs) (y :: ys) = x_2.add y :: Hex.Matrix.Lists.add xs ys
Instances For
Structural integer coefficient convolution.
Equations
- Hex.Matrix.Lists.mul [] x✝ = []
- Hex.Matrix.Lists.mul (x_2 :: xs) x✝ = Hex.Matrix.Lists.add (Hex.Matrix.Lists.scale x_2 x✝) (0 :: Hex.Matrix.Lists.mul xs x✝)