NLA-lib Explorer

NLAlib.ShiftedQR.scanRound_writes_word

Library · theorem

One visit on any scalar machine whose natural literals up to n are exact: it computes the word NLAlib.ShiftedQR.subdiagonalSqWord and, when it passes the actual comparison with the threshold word, writes the flag 1 and the index k; otherwise the flag and index words are kept. The matrix and threshold have disjoint views from the five arithmetic/flag/index words. Shared by the trees of NLAlib.ShiftedQR.scalarDecouple, NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.scanRound_writes_word {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) (hL : Ops.IsIndexLit M I) (hC : Ops.IsCmp id I) {τ : Ops.Tape ℝ}
  {m : Ops.Mem ℝ} {n k : ℕ} {a t r : ℕ × ℕ} (hN : Ops.IsExactNatLit id M n)
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {threshold flag index : ℝ} (hk : k < n)
  (hH : HoldsMatrix a H m.store) (ht : m.store.get t.1 t.2 = some threshold)
  (hflag : m.store.get r.1 (r.2 + 3) = some flag) (hindex : m.store.get r.1 (r.2 + 4) = some index)
  (hl : m.Live [a, t, r]) (hroom : r.2 + 5 ≤ m.store.len r.1)
  (hA :
    Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 5) (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))))
  (hT : Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 5) (Ops.Store.inBlock t.1 t.2 1)) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.scanRound (Ops.Env.frame [n + 1, k] [a, t, r])
    (Ops.Store.inBlock r.1 r.2 5)
    (fun m' ↦
      m'.pos = m.pos ∧
        m'.store.get r.1 (r.2 + 3) =
            some (if ShiftedQR.subdiagonalSqWord M H k ≤ threshold then 1 else flag) ∧
          m'.store.get r.1 (r.2 + 4) =
            some (if ShiftedQR.subdiagonalSqWord M H k ≤ threshold then ↑k else index))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.Scan.