NLA-lib Explorer

NLAlib.rotateColumnsWithScratch_writes_word

Library · theorem

Scalar pair rotations on any machine store the machine column rotation (NLAlib.machineColRotation) of the columns k, k + 1. The matrix and coefficients are disjoint, and a separate ten-word buffer is reused for all rows. The two coefficient views may overlap each other. [GolubVanLoan2013, §5.1.8]. Shared by the trees of NLAlib.ShiftedQR.deflationRoutine, NLAlib.hessenbergReduceLast, NLAlib.ShiftedQR.shiftedStepRoutine, NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.rotateColumnsWithScratch_writes_word {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 k : ℕ} {a c s t : ℕ × ℕ} {H : Matrix (Fin n) (Fin n) ℂ} {cv sv : ℂ}
  (hk : k + 1 < n) (hH : HoldsMatrix a H m.store)
  (hc : m.store.readBlock c.1 c.2 2 = some [cv.re, cv.im])
  (hs : m.store.readBlock s.1 s.2 2 = some [sv.re, sv.im])
  (hca : Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * (n * n))) (Ops.Store.inBlock c.1 c.2 2))
  (hsa : Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * (n * n))) (Ops.Store.inBlock s.1 s.2 2))
  (hta : t.1 ≠ a.1) (htc : t.1 ≠ c.1) (hts : t.1 ≠ s.1) (ht : t.2 + 10 ≤ m.store.len t.1) :
  Ops.Writes Ops.Mode.total I τ rotateColumnsWithScratch (Ops.Env.frame [n, k] [a, c, s, t, a])
    (Ops.Store.inBlock a.1 a.2 (2 * (n * n)) ⊔ Ops.Store.inBlock t.1 t.2 10)
    (fun m' ↦
      m'.pos = m.pos ∧ HoldsMatrix a (machineColRotation M ⟨k, ⋯⟩ ⟨k + 1, hk⟩ cv sv H) m'.store)
    m

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.GivensPrograms.