NLA-lib Explorer

NLAlib.ShiftedQR.findRounded_writes_choice

Library · theorem

Find in floating point selects a choice of Find with computed values: on a scalar machine whose natural literals up to k = 2^m are exact, with exact comparisons and index conversion, a comparison routine Tau meeting NLAlib.ShiftedQR.IsHalfTau for \mathbf{H} (of order n + 1, at A) and the k shifts (as pairs at SS), the program NLAlib.ShiftedQR.findRounded writes only the pair Center, keeps the tape position, and stores there a shift c with NLAlib.IsFindRitzChoice H m 1 shifts c. The shifts and Center are disjoint views. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.findRounded_writes_choice {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has Ops.CmpTst Q] [Ops.Has Ops.IdxTst Q] {M : Ops.Machine ℝ}
  {I : Ops.Interp O Q ℝ} {Tau : Ops.Stmt O Q} (hS : Ops.IsScalar M I) (hL : Ops.IsIndexLit M I)
  (hCmp : Ops.IsCmp id I) (hQ : Ops.IsToNat id I) {n m k : ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {shifts : List ℂ}
  (hTau : ShiftedQR.IsHalfTau H shifts Tau I) (hNat : Ops.IsExactNatLit id M k) {τ : Ops.Tape ℝ}
  {μ : Ops.Mem ℝ} {b ss z : ℕ × ℕ} (hkm : k = 2 ^ m) (hk : shifts.length = k)
  (hB : HoldsMatrix b H μ.store)
  (hSS :
    μ.store.readBlock ss.1 ss.2 (2 * shifts.length) =
      some (List.flatMap (fun z ↦ [z.re, z.im]) shifts))
  (hl : μ.Live [b, ss, z])
  (hsep : Ops.Fp.Disj (Ops.Store.inBlock ss.1 ss.2 (2 * k)) (Ops.Store.inBlock z.1 z.2 2))
  (hz : z.2 + 2 ≤ μ.store.len z.1) :
  Ops.Writes Ops.Mode.total I τ (ShiftedQR.findRounded Tau) (Ops.Env.frame [n + 1, m, k] [b, ss, z])
    (Ops.Store.inBlock z.1 z.2 2)
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ c, μ'.store.readBlock z.1 z.2 2 = some [c.re, c.im] ∧ IsFindRitzChoice H m 1 shifts c)
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedFind.