NLA-lib Explorer

NLAlib.Ops.Store.readBlock_packFinMatrix_columns

Library · theorem

The leading columns of a packed column-major matrix form a contiguous readable block. This is a storage consequence, requiring no arithmetic or matrix primitive contract.

NLAlib.Ops.Store.readBlock_packFinMatrix_columns {K E : Type} (C : Ops.EntryCodec K E)
  {s : Ops.Store K} {b off rows cols count : ℕ} {A : Matrix (Fin rows) (Fin cols) E}
  (h : s.readBlock b off (cols * rows * C.width) = some (C.packFinMatrix A)) (hc : count ≤ cols) :
  s.readBlock b off (count * rows * C.width) =
    some (C.packFinMatrix (A.submatrix id (Fin.castLE hc)))

Full source on GitHub

Import NLAlib.Ops.Logic.MatrixPacked.