NLA-lib Explorer

NLAlib.ShiftedQR.stepInPlaceWithScratch_writes

Library · theorem

Exact arithmetic

One actual shifted step followed by scalar copy-back computes the mathematical shifted step in place. The temporary matrix and supplied shift are spatially disjoint from outputs. A fragment of the exact decoupler NLAlib.ShiftedQR.scalarDecouple, which exact shifted QR (NLAlib.ShiftedQR.deflationRoutine) takes as its decoupler.

NLAlib.ShiftedQR.stepInPlaceWithScratch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I)
  (hE : Ops.ExactModel id M) (hCmp : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n : ℕ}
  {a s t : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {shift : ℂ} (hl : m.Live [a, s, t])
  (hH : HoldsMatrix a H m.store) (hs : m.store.readBlock s.1 s.2 2 = some [shift.re, shift.im])
  (ht : t.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len t.1)
  (hat :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1)))))
  (hst :
    Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 2)
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))))) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.stepInPlaceWithScratch
    (Ops.Env.frame [n + 1] [a, s, t, a])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
      Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))))
    (fun μ ↦ μ.pos = m.pos ∧ HoldsMatrix a (shiftedQRStep H shift) μ.store) m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.MultiStep.