---
title: SparseGMRES()
framework: accelerate
role: symbol
role_heading: Function
path: accelerate/sparsegmres()
---

# SparseGMRES()

Returns a generalized minimal residual (GMRES) method.

## Declaration

```swift
func SparseGMRES() -> SparseIterativeMethod
```

## Return Value

Return Value A SparseIterativeMethod structure that represents a generalized minimal residual (GMRES) method.

## Discussion

Discussion Use GMRES to solve Ax = b when A is symmetric indefinite or unsymmetric. For symmetric positive-definite systems, use SparseConjugateGradient(_:). For rectangular or singular systems, use SparseLSMR(_:).

## See Also

### Sparse Iterative Methods for Symmetric Indefinite and Unsymmetric Coefficient Matrices

- [SparseGMRES(_:)](accelerate/sparsegmres(_:).md)
- [SparseGMRESOptions](accelerate/sparsegmresoptions.md)
