NLA-lib Explorer

NLAlib.rotateRowsWithScratch_writes

Library · theorem

Exact arithmetic

Exact scalar pair rotations implement multiplication by the Givens matrix on the left. The matrix and coefficients are disjoint, and a separate ten-word buffer is reused for all columns. The two coefficient views may overlap each other. [GolubVanLoan2013, §5.1.8]. Shared by the trees of NLAlib.ShiftedQR.deflationRoutine, NLAlib.hessenbergReduceLast, NLAlib.ShiftedQR.scalarDecouple, NLAlib.ShiftedQR.shiftedStepRoutine, NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.rotateRowsWithScratch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] {M : Ops.Machine ℝ}
  {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) (hE : Ops.ExactModel id M) {τ : 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 τ rotateRowsWithScratch (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 (givens ⟨k, ⋯⟩ ⟨k + 1, hk⟩ cv sv * H) m'.store) m

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.GivensPrograms.