NLA-lib Explorer

NLAlib.Cholesky.leftLookingBelow_writes

Library · theorem

Standard rounding

The loop over the entries below the diagonal of column j, a fragment of NLAlib.Cholesky.leftLooking: every entry is accumulated in place and divided by the diagonal. The columns before j, the diagonal and the entries above it are not written.

NLAlib.Cholesky.leftLookingBelow_writes {K Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  {M : Ops.Machine K} {I : Ops.Interp Op Tst K} (hI : Ops.IsScalar M I) {u : ℝ} {dec : K → ℝ}
  (hM : Ops.StdModel u dec M) {τ : Ops.Tape K} {ρ : Ops.Env} {m : Ops.Mem K}
  {bound inner : Ops.IExp} {n j o b₀ : ℕ} {w : ℕ × ℕ} {a₀ b c d t : Ops.Operand} {W₀ : ℕ → K}
  {a : ℕ → ℕ → ℝ} (hj : j < n) (hbound : Ops.IExp.eval ρ.idx bound = some (n - (j + 1)))
  (hinner : ∀ (i : ℕ), Ops.IExp.eval (ρ.pushIdx i).idx inner = some j)
  (ha :
    ∀ (i k : ℕ), Ops.Operand.eval ((ρ.pushIdx i).pushIdx k) a₀ = some (b₀, o + k * n + (j + 1 + i)))
  (hb : ∀ (i k : ℕ), Ops.Operand.eval ((ρ.pushIdx i).pushIdx k) b = some (b₀, o + k * n + j))
  (hc : ∀ (i : ℕ), Ops.Operand.eval (ρ.pushIdx i) c = some (b₀, o + j * n + (j + 1 + i)))
  (hd : ∀ (i : ℕ), Ops.Operand.eval (ρ.pushIdx i) d = some (b₀, o + j * n + j))
  (ht : ∀ (i k : ℕ), Ops.Operand.eval ((ρ.pushIdx i).pushIdx k) t = some w) (hbw : b₀ ≠ w.1)
  (hw : w.2 < m.store.len w.1) (hW : TriangularSolve.CellsHold m.store b₀ o (n * n) W₀)
  (horig : ∀ (r : ℕ), j < r → r < n → dec (W₀ (j * n + r)) = a r j) :
  Ops.Writes Ops.Mode.total I τ
    (Ops.Stmt.loop bound
      ((Ops.Stmt.loop inner
            ((Ops.Stmt.call (Ops.Has.inj Ops.ScalarOp.mul) [] [a₀, b] [t]).seq
              (Ops.Stmt.call (Ops.Has.inj Ops.ScalarOp.sub) [] [c, t] [c]))).seq
        (Ops.Stmt.call (Ops.Has.inj Ops.ScalarOp.div) [] [c, d] [c])))
    ρ (Ops.Store.inBlock b₀ o (n * n) ⊔ Ops.Store.inBlock w.1 w.2 1)
    (fun m' ↦
      m'.pos = m.pos ∧
        ∃ W',
          TriangularSolve.CellsHold m'.store b₀ o (n * n) W' ∧
            (∀ (c r : ℕ), r < n → c ≠ j ∨ r ≤ j → W' (c * n + r) = W₀ (c * n + r)) ∧
              Cholesky.BelowPrefix u dec a n j (n - (j + 1)) W')
    m

Full source on GitHub

Import NLAlib.Matrix.Factorizations.Cholesky.Routine.