NLA-lib Explorer

NLAlib.cgState

Library · def

The Hestenes–Stiefel recurrence (the conjugate gradient algorithm) from the start \mathbf{x}_0: the state after k steps, from (\mathbf{x}_0, \mathbf{r}_0, \mathbf{r}_0), \mathbf{r}_0 = \mathbf{b} - \mathbf{A}\mathbf{x}_0. [HestenesStiefel1952, (3:1)]; the start \mathbf{p}_0 = \mathbf{r}_0 is (3:1a) there. Algorithm: cg

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

Full source on GitHub

Import NLAlib.Krylov.LinearSystems.CGRecurrence.