NLA-lib Explorer

NLAlib.ShiftedQR.acceptTrialWithScratch_writes

Library · theorem

Exact arithmetic

Total acceptance classification from the actual supplied trial matrix and stored threshold and target. Scratch, output and input separation concern real word regions, including views of one arena. No assumption about which trial will pass is made. A fragment of the exact decoupler NLAlib.ShiftedQR.scalarDecouple, which exact shifted QR (NLAlib.ShiftedQR.deflationRoutine) takes as its decoupler.

NLAlib.ShiftedQR.acceptTrialWithScratch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.IndexOp Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ}
  (hS : Ops.IsScalar M I) (hE : Ops.ExactModel id M) (hL : Ops.IsIndexLit M I) (hC : Ops.IsCmp id I)
  {τp : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n k : ℕ} {a t target r p f : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {τ T : ℝ} (hk : k ≤ n) (hτ : 0 ≤ τ)
  (hH : HoldsMatrix a H m.store) (ht : m.store.get t.1 t.2 = some (τ ^ 2))
  (hTarget : m.store.get target.1 target.2 = some T) (hl : m.Live [a, t, target, r, p, f])
  (hr : r.2 + 5 ≤ m.store.len r.1) (hp : p.2 < m.store.len p.1) (hf : f.2 < m.store.len f.1)
  (hapart : Ops.Fp.Apart [r, p, f] [5, 1, 1])
  (hsep :
    (Ops.Fp.blocks [r, p, f] [5, 1, 1]).Disj
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock t.1 t.2 1 ⊔
        Ops.Store.inBlock target.1 target.2 1)) :
  Ops.Writes Ops.Mode.total I τp ShiftedQR.acceptTrialWithScratch
    (Ops.Env.frame [n + 1, k] [a, t, target, r, p, f]) (Ops.Fp.blocks [r, p, f] [5, 1, 1])
    (fun m' ↦
      m'.pos = m.pos ∧
        m'.store.get f.1 f.2 =
          some (if IsDecoupledAbs τ H ∨ subdiagNormSqProd k H ≤ T then 1 else 0))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.Acceptance.