NLA-lib Explorer

NLAlib.CGS2.finish_writes

Library · theorem

The deflation test of a round. From a memory whose first scalar cell holds the saved norm ν₀ and whose column c of the block holds the reduced column w₂, the test computes a norm β of w₂ and writes column c of the new block: if β is at most the machine product of the threshold literal and ν₀, the column is zero and the diagonal coefficient is not written; otherwise the column is w₂ scaled by β and the diagonal coefficient is β. A fragment of NLAlib.CGS2.cgs2ExtendRoutine.

NLAlib.CGS2.finish_writes {K Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine K} {dec : K → ℝ} {ed : ℕ → ℝ}
  {ea : ℝ} {N : ℕ → (ℕ → K) → K → Prop} {S : ℕ → K → (ℕ → K) → (ℕ → K) → Prop} {ok : ℕ → Prop}
  {I : Ops.Interp Op Tst K} (ops : CGS2.ColOps M dec ed ea N S ok I) {τ' : Ops.Tape K} {τ : ℚ}
  {n k b c : ℕ} {Q W C : ℕ × ℕ} {hb tb : ℕ} {m : Ops.Mem K} {ν₀ : K} {w₂ : List K}
  (L : CGS2.ColMem n k b Q W C hb tb m) (hc : c < b) (hok : ok n) (hν : m.store.get tb 0 = some ν₀)
  (hw : m.store.readBlock W.1 (W.2 + c * n) n = some w₂) :
  Ops.Writes Ops.Mode.total I τ' (CGS2.cgs2ExtendFinish τ) (CGS2.colEnv n k b c Q W C hb tb)
    (Ops.Store.inBlock Q.1 (Q.2 + k * n + c * n) n ⊔
        Ops.Store.inBlock C.1 (C.2 + c * (k + b) + k + c) 1 ⊔
      Ops.Store.inBuf tb)
    (fun m' ↦
      m'.pos = m.pos ∧
        ∃ β qc,
          N n (Ops.vec w₂) β ∧
            m'.store.readBlock Q.1 (Q.2 + k * n + c * n) n = some qc ∧
              (dec β ≤ dec (M.mul (M.lit τ) ν₀) ∧
                  (∀ i < n, Ops.vec qc i = M.lit 0) ∧
                    m'.store.get C.1 (C.2 + c * (k + b) + k + c) =
                      m.store.get C.1 (C.2 + c * (k + b) + k + c) ∨
                ¬dec β ≤ dec (M.mul (M.lit τ) ν₀) ∧
                  S n β (Ops.vec w₂) (Ops.vec qc) ∧
                    m'.store.get C.1 (C.2 + c * (k + b) + k + c) = some β))
    m

Full source on GitHub

Import NLAlib.Krylov.Orthogonalization.CGS2.ExtendColumn.