Public API
Contents
Index
Public interface
ConjugateGradient.Iteration — Type
Iteration(alpha, beta, x, r, p)Record data in a single iteration within the conjugate gradient method.
ConjugateGradient.cg — Function
cg(𝐀, 𝐛, 𝐱₀=zeros(length(𝐛)); atol=eps(), maxiter=2000)Solves the linear system $𝐀 𝐱 = 𝐛$ using the Conjugate Gradient method.
Arguments
𝐀: square, symmetric, positive-definite matrix.𝐛: right-hand side vector.𝐱₀: initial guess for the solution. Defaults to a zero vector of appropriate length.atol: absolute tolerance for convergence. Defaults to machine epsilon.maxiter: maximum number of iterations. Defaults to2000.
Returns
𝐱: the solution vector.iterations: anOffsetVectorcontaining iteration history for each step.isconverged: a boolean indicating whether the algorithm has converged.