<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseLSMROptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@SA@SparseLSMROptions"
  },
  "title" : "SparseLSMROptions"
}
-->

# SparseLSMROptions

Options for creating a least squares minimum residual method.

```
struct SparseLSMROptions
```

## 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(_:)`](/documentation/Accelerate/SparseConjugateGradient(_:)). For square, full-rank unsymmetric or indefinite equations, use [`SparseGMRES(_:)`](/documentation/Accelerate/SparseGMRES(_:)).

## Topics

### Initializers

[`init()`](/documentation/Accelerate/SparseLSMROptions/init())

Returns a new LSMR options structure.

[`init(reportError:lambda:nvec:convergenceTest:atol:rtol:btol:conditionLimit:maxIterations:reportStatus:)`](/documentation/Accelerate/SparseLSMROptions/init(reportError:lambda:nvec:convergenceTest:atol:rtol:btol:conditionLimit:maxIterations:reportStatus:))

Returns a new LSMR options structure using the specified parameters.

### Inspecting LSMR Options

[`atol`](/documentation/Accelerate/SparseLSMROptions/atol)

The absolute tolerance (default test) or *A* tolerance (Fong-Saunders test).

[`btol`](/documentation/Accelerate/SparseLSMROptions/btol)

The *B* tolerance (Fong-Saunders test only).

[`conditionLimit`](/documentation/Accelerate/SparseLSMROptions/conditionLimit)

The condition number limit (Fong-Saunders test only).

[`convergenceTest`](/documentation/Accelerate/SparseLSMROptions/convergenceTest)

The convergence test to use for iterative solve methods.

[`SparseLSMRConvergenceTest_t`](/documentation/Accelerate/SparseLSMRConvergenceTest_t)

Constants that specify the type of convergence test.

[`lambda`](/documentation/Accelerate/SparseLSMROptions/lambda)

The damping parameter lambda for regularized least squares.

[`maxIterations`](/documentation/Accelerate/SparseLSMROptions/maxIterations)

The maximum number of iterations.

[`nvec`](/documentation/Accelerate/SparseLSMROptions/nvec)

The number of vectors to use for local reorthogonalization.

[`reportError`](/documentation/Accelerate/SparseLSMROptions/reportError)

An optional error-reporting routine.

[`reportStatus`](/documentation/Accelerate/SparseLSMROptions/reportStatus)

An optional status-reporting routine.

[`rtol`](/documentation/Accelerate/SparseLSMROptions/rtol)

The relative convergence tolerance (default test only).



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)