NLA-lib Explorer

NLAlib.ShiftedQR.copyToGlobal_writes

Library · theorem

Dense workspace is copied back into exactly its bounded global diagonal block. Global capacity is the original matrix capacity, with no additional padding after the final column. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.copyToGlobal_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] {M : Ops.Machine ℝ}
  {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n lo d : ℕ}
  {a w : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {B : Matrix (Fin d) (Fin d) ℂ}
  (hl : m.Live [w, a]) (hH : HoldsMatrix a H m.store) (hB : HoldsMatrix w B m.store)
  (hr : lo + d ≤ n + 1) (ha : a.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len a.1)
  (hd :
    Ops.Fp.Disj (Ops.Store.inBlock w.1 w.2 (2 * (d * d)))
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.copyToGlobal (Ops.Env.frame [n + 1, lo, d] [w, a])
    ((Ops.EntryCodec.pair ℝ).regionFp a.1 (a.2 + 2 * (lo * (n + 1) + lo)) d
      (fun i j ↦ j * (n + 1) + i) fun x ↦ d)
    (fun m' ↦ m'.pos = m.pos ∧ HoldsMatrix a (setSubBlock H (lo, d) B) m'.store) m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.BlockCopy.