Leading principal k × k submatrix of a square matrix: the top-left block
indexed by {0, …, k-1} along both axes. Includes the empty submatrix
(k = 0) and is convenient for Bareiss pivot/minor statements.
Equations
Instances For
A copy-free view of a rows × cols block, possibly zero-padded past its
real-data extent, into a shared backing Matrix R N M. Reading (i, j) returns
base[(r0 + i, c0 + j)] when r0 + i < rhi ∧ c0 + j < chi (real data) and 0
otherwise (pad). The invariants pin the window endpoints inside the backing and
inside the logical block, so the real data is a prefix of each axis. There is
deliberately no r0 ≤ rhi invariant: a reversed window (rhi ≤ r0) is the
canonical empty-window encoding — every real-data test is false and the view
denotes an all-zero block, which is exactly what a quadrant lying wholly in the
pad fringe needs.
- baseRows : Nat
Backing row count.
- baseCols : Nat
Backing column count.
Shared backing buffer; sub-views alias it, never copy it.
- r0 : Nat
Row offset into the backing.
- c0 : Nat
Column offset into the backing.
- rhi : Nat
One past the last real-data row (backing coordinate).
- chi : Nat
One past the last real-data column (backing coordinate).
Real rows stay inside the backing.
Real columns stay inside the backing.
Real rows are a prefix of the logical rows.
Real columns are a prefix of the logical columns.
Instances For
Materialize a view into a genuine Matrix (a copy of the block, with the
zero-pad fringe filled in). This is the leaf/operand allocation the recursion
pays; interior quadrants stay views.
Instances For
The full-matrix view of a Matrix: offset 0, real extent the whole matrix.
Equations
- Hex.Submatrix.ofMatrix Mx = { baseRows := n, baseCols := m, base := Mx, r0 := 0, c0 := 0, rhi := n, chi := m, hrN := ⋯, hcM := ⋯, hrR := ⋯, hcC := ⋯ }
Instances For
Widen a view's logical shape to n' × m' (n ≤ n', m ≤ m') without copying:
the real-data window is unchanged, so the new fringe reads 0. This is the
zero-padding the Strassen recursion applies before splitting.
Equations
Instances For
Top-left h × w quadrant of an (h+h) × (w+w) view: same offset, real extent
capped at the block boundary. No copy.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Entrywise sum of two views, materialized into a fresh matrix (an operand-sum allocation).
Equations
- A.add B = Hex.Submatrix.ofMatrix (Hex.Matrix.ofFn fun (i : Fin rows) (j : Fin cols) => A.entry i j + B.entry i j)
Instances For
Entrywise difference of two views, materialized into a fresh matrix.
Equations
- A.sub B = Hex.Submatrix.ofMatrix (Hex.Matrix.ofFn fun (i : Fin rows) (j : Fin cols) => A.entry i j - B.entry i j)