NLA-lib Explorer

NLAlib.Ops.Store.HoldsMat.readBlock

Library · theorem

A dense matrix is a flat block (the bridge to the contracts in operand form, whose blocks are flat lists): with rows = ld, the layout is the block of cols * rows cells, entry (i, j) at j * rows + i.

NLAlib.Ops.Store.HoldsMat.readBlock {K : Type} [Inhabited K] {s : Ops.Store K} {L : Ops.MatLayout}
  {A : ℕ → ℕ → K} (h : s.HoldsMat L A) (hL : L.rows = L.ld) :
  ∃ ys,
    s.readBlock L.buf L.off (L.cols * L.rows) = some ys ∧
      ys.length = L.cols * L.rows ∧ ∀ i < L.rows, ∀ j < L.cols, Ops.vec ys (j * L.rows + i) = A i j

Full source on GitHub

Import NLAlib.Ops.Logic.Layout.