NLA-lib Explorer

NLAlib.pcgIterate

Library · def

The preconditioned conjugate gradient iterate after q steps from \mathbf{x}_0, with preconditioner \mathbf{M} applied as \mathbf{M} and \mathbf{r}_0 = \mathbf{b} - \mathbf{A}\mathbf{x}_0: \mathsf{pcgIterate}(\mathbf{A}, \mathbf{M}, \mathbf{b}, \mathbf{x}_0, q) := \mathbf{x}_0 + \mathsf{galerkinInverse}(\mathbf{A}, \mathbf{K}_q(\mathbf{M}\mathbf{A}, \mathbf{M}\mathbf{r}_0))\,\mathbf{r}_0. Basis-free, total, no square root; the preconditioned Hestenes–Stiefel recurrence computes it (Matrix.PosDef.pcgState_x_eq). Junk value: that of galerkinInverse when the compression of \mathbf{A} is singular. [Saad2003, §9.2]; [Greenbaum1997, §8.1]; locators to verify. Algorithm: pcg (specification)

NLAlib.pcgIterate.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] [DecidableEq n]
  (A M : Matrix n n 𝕜) (b x₀ : n → 𝕜) (q : ℕ) : n → 𝕜

Full source on GitHub

Import NLAlib.Krylov.LinearSystems.PCG.