SparseConjugateGradient(_:)
Returns a conjugate gradient (CG) method with specified options.
Declaration
func SparseConjugateGradient(_ options: SparseCGOptions) -> SparseIterativeMethodParameters
- options:
The options to use when creating the conjugate gradient method, such as the maximum number of iterations to perform.
Return Value
A SparseIterativeMethod structure that represents a default conjugate gradient method.
Discussion
Use CG to solve Ax = b when A is symmetric positive-definite. The method may break down or fail to converge if A isn’t positive-definite.
For square, full-rank, unsymmetric or indefinite equations, use SparseGMRES(_:). For rectangular or singular systems, use SparseLSMR(_:).