NLA-lib Explorer

NLAlib.Krylov.Lanczos.Rounded.initialize_writes

Library · theorem

Standard rounding Relative-error BLAS

Readable inputs and input precision suffice for initialization at every cap. Every output tail is initialized, and zero input avoids division by zero.

A fragment of NLAlib.Krylov.Lanczos.solveRoutine: the start of its tree, on the previous vector and scalar cells the solver allocates and a computed tail of C. Unlike the initialization of conjugate gradient, which has whole operands of its own and several callers, it is not a routine.

NLAlib.Krylov.Lanczos.Rounded.initialize_writes {K : Type} [Inhabited K] {Op Tst : Type}
  [Ops.Has Ops.ScalarOp Op] [Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine K}
  {dec : K → ℝ} {n cap clen L : ℕ} {A : Matrix (Fin n) (Fin n) ℝ} {em u E : ℝ} {e : Ops.Blas1Err}
  {I : Ops.Interp Op Tst K} {ok : ℕ → Prop} (hS : Ops.IsScalar M I) (hM : Ops.StdModel u dec M)
  (hB : Ops.IsBlas1 dec e ok I) (hok : ok n) (hCmp : Ops.IsCmp dec I)
  (hprec : Krylov.Lanczos.Rounded.Precision em u E e n) {τ : Ops.Tape K} {μ : Ops.Mem K}
  {B V C : ℕ × ℕ} {bs : List K} (hBV : B.1 ≠ V.1) (hBC : B.1 ≠ C.1) (hVC : V.1 ≠ C.1)
  (hBL : B.1 < L) (hVL : V.1 < L) (hCL : C.1 < L) (hlen : List.length μ.store = L + 3)
  (hp : μ.store.len L = n) (ht : μ.store.len (L + 2) = 2) (hclen : 2 * cap + 2 ≤ clen)
  (hb : μ.store.readBlock B.1 B.2 n = some bs) (hv : V.2 + (cap + 1) * n ≤ μ.store.len V.1)
  (hc : C.2 + clen ≤ μ.store.len C.1) :
  Ops.Writes Ops.Mode.total I τ Krylov.Lanczos.initializeState
    (Ops.Env.frame [n, cap, clen] [B, V, C, (L, 0), (L + 2, 0)])
    (Ops.Fp.blocks [V, C] [(cap + 1) * n, clen] ⊔ Ops.Fp.above L)
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ z, Krylov.Lanczos.Rounded.State dec A (Ops.decv dec n bs) E cap 0 V C L z μ'.store)
    μ

Full source on GitHub

Import NLAlib.Krylov.Lanczos.Rounded.Initialization.