NLA-lib Explorer

NLAlib.Krylov.CG.Reorth.direction_writes

Library · theorem

Exact arithmetic

The direction uses the new swept residual norm and the saved nonzero old squared norm.

A fragment of NLAlib.Krylov.CG.Reorth.solveRoutine, not a routine: it runs on the scratch of round and reads the old squared norm that update left in the scalar cell t[0].

NLAlib.Krylov.CG.Reorth.direction_writes {K Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] {M : Ops.Machine K} {dec : K → ℝ} {I : Ops.Interp Op Tst K}
  (hS : Ops.IsScalar M I) (hM : Ops.ExactModel dec M) (hB : Ops.IsExactBlas1 dec (fun x ↦ True) I)
  {n L : ℕ} {τ : Ops.Tape K} {μ : Ops.Mem K} {r p : ℕ × ℕ} {rs ps : List K} {rr : K} (hrL : r.1 < L)
  (hpL : p.1 < L) (hl : List.length μ.store = L + 3) (hZ : μ.store.len (L + 1) = n)
  (ht : μ.store.len (L + 2) = 4) (hpz : p.2 + n ≤ μ.store.len p.1)
  (hrs : μ.store.readBlock r.1 r.2 n = some rs) (hps : μ.store.readBlock p.1 p.2 n = some ps)
  (hrr : μ.store.get (L + 2) 0 = some rr) (hrr0 : dec rr ≠ 0) :
  Ops.Writes Ops.Mode.total I τ Krylov.CG.Reorth.direction
    (Ops.Env.frame [n] [r, p, (L + 1, 0), (L + 2, 0), p])
    (Ops.Fp.blocks [p, (L + 1, 0), (L + 2, 0)] [n, n, 4])
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ ps',
          μ'.store.readBlock p.1 p.2 n = some ps' ∧
            Ops.decv dec n ps' =
              Ops.decv dec n rs +
                (Ops.decv dec n rs ⬝ᵥ Ops.decv dec n rs / dec rr) • Ops.decv dec n ps)
    μ

Full source on GitHub

Import NLAlib.Krylov.CG.Reorth.Direction.