Function

SparseLSMR(_:)

Returns a least squares minimum residual method with specified options.

Declaration

func SparseLSMR(_ options: SparseLSMROptions) -> SparseIterativeMethod

Parameters

options

The LSMR options to use when creating the LSMR method.

Return Value

A SparseIterativeMethod structure representing a default LSMR Method.

Discussion

LSMR is MINRES specialized for solving least squares. Use LSMR to solve equations of the form Ax = b where an exact solution does not exist. The returned solution minimizes ‖ b-Ax ‖₂.

Although LSMR is equivalent to MINRES applied to the normal equations AAx = Ab in exact arithmetic, it has superior numerical behavior and is preferred. Due to the implicit squaring of the condition of A in the normal equations, LSMR may struggle to converge in single precision, and double precision arithmetic is recommended.

For symmetric positive-definite systems, use SparseConjugateGradient(_:) instead. For square, full-rank unsymmetric or indefinite equations, use SparseGMRES(_:).

See Also

Sparse Iterative Methods

func SparseConjugateGradient(SparseCGOptions) -> SparseIterativeMethod

Returns a conjugate gradient method with specified options.

struct SparseCGOptions

Options for creating a conjugate gradient method.

func SparseGMRES() -> SparseIterativeMethod

Returns a generalized minimal residual method.

func SparseGMRES(SparseGMRESOptions) -> SparseIterativeMethod

Returns a generalized minimal residual method with specified options.

struct SparseGMRESOptions

Options for creating a generalized minimal residual method.

func SparseLSMR() -> SparseIterativeMethod

Returns a default least squares minimum residual method.

struct SparseLSMROptions

Options for creating a least squares minimum residual method.