---
title: SparseLSMROptions
framework: accelerate
role: symbol
role_heading: Structure
path: accelerate/sparselsmroptions
---

# SparseLSMROptions

Options for creating a least squares minimum residual method.

## Declaration

```swift
struct SparseLSMROptions
```

## Overview

Overview LSMR is a minimal residual (MINRES) method for solving least squares. Use LSMR to solve equations of the form Ax = b where an exact solution doesn’t exist. The returned solution minimizes ‖ b-Ax ‖₂. Although LSMR is equivalent to applying MINRES to the normal equations A__ᵀ__Ax = A__ᵀ__b in exact arithmetic, it has superior numerical behavior and is the preferred method. Due to the implicit squaring of the condition of A in the normal equations, LSMR may struggle to converge in single precision. Use double-precision arithmetic where possible. For symmetric positive-definite systems, use SparseConjugateGradient(_:). For square, full-rank unsymmetric or indefinite equations, use SparseGMRES(_:).

## Topics

### Initializers

- [init()](accelerate/sparselsmroptions/init().md)
- [init(reportError:lambda:nvec:convergenceTest:atol:rtol:btol:conditionLimit:maxIterations:reportStatus:)](accelerate/sparselsmroptions/init(reporterror:lambda:nvec:convergencetest:atol:rtol:btol:conditionlimit:maxiterations:reportstatus:).md)

### Inspecting LSMR Options

- [atol](accelerate/sparselsmroptions/atol.md)
- [btol](accelerate/sparselsmroptions/btol.md)
- [conditionLimit](accelerate/sparselsmroptions/conditionlimit.md)
- [convergenceTest](accelerate/sparselsmroptions/convergencetest.md)
- [SparseLSMRConvergenceTest_t](accelerate/sparselsmrconvergencetest_t.md)
- [lambda](accelerate/sparselsmroptions/lambda.md)
- [maxIterations](accelerate/sparselsmroptions/maxiterations.md)
- [nvec](accelerate/sparselsmroptions/nvec.md)
- [reportError](accelerate/sparselsmroptions/reporterror.md)
- [reportStatus](accelerate/sparselsmroptions/reportstatus.md)
- [rtol](accelerate/sparselsmroptions/rtol.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Sendable](swift/sendable.md)

## See Also

### Sparse Iterative Methods for Overdetermined and Underdetermined Systems

- [SparseLSMR()](accelerate/sparselsmr().md)
- [SparseLSMR(_:)](accelerate/sparselsmr(_:).md)
