NLA-lib Explorer

NLAlib.HasOrthonormalCols.cgIterate_eq

Library · theorem

CG in any orthonormal basis of the Krylov space, for every \mathbf{A}: \mathsf{cgIterate}(\mathbf{A}, \mathbf{b}, \mathbf{x}_0, q) = \mathbf{x}_0 + \mathbf{Q}(\mathbf{Q}^{\mathsf{H}}\mathbf{A}\mathbf{Q})^{+}\mathbf{Q}^{\mathsf{H}}\mathbf{r}_0.

NLAlib.HasOrthonormalCols.cgIterate_eq.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  {r : Type u_3} [Fintype n] [DecidableEq n] [Fintype r] [DecidableEq r] {Q : Matrix n r 𝕜}
  (hQ : HasOrthonormalCols Q) {A : Matrix n n 𝕜} {b x₀ : n → 𝕜} {q : ℕ}
  (hK : Q.mulVecLin.range = krylovSpace A (b - A *ᵥ x₀) q) :
  cgIterate A b x₀ q = x₀ + Q *ᵥ pinv (Qᴴ * A * Q) *ᵥ Qᴴ *ᵥ (b - A *ᵥ x₀)

Full source on GitHub

Import NLAlib.Krylov.LinearSystems.CG.