<!--
{
  "availability" : [
    "iOS: 18.5.0 -",
    "iPadOS: 18.5.0 -",
    "macCatalyst: 18.5.0 -",
    "macOS: 15.5.0 -",
    "tvOS: 18.5.0 -",
    "visionOS: 2.5.0 -",
    "watchOS: 11.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseSolve(_:_:_:_:_:)-2bm9r",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseSolve#$@SA@SparseIterativeMethod#BFv(#b#$@E@CBLAS_TRANSPOSE#$@SA@DenseVector_Complex_Float#S4_)#S4_#S4_#$@SA@SparseOpaquePreconditioner_Complex_Float#"
  },
  "title" : "SparseSolve(_:_:_:_:_:)"
}
-->

# SparseSolve(_:_:_:_:_:)

Solve `Ax=b` using the specified iterative method for complex float values.

```
func SparseSolve(_ method: SparseIterativeMethod, _ ApplyOperator: @escaping (Bool, CBLAS_TRANSPOSE, DenseVector_Complex_Float, DenseVector_Complex_Float) -> Void, _ b: DenseVector_Complex_Float, _ x: DenseVector_Complex_Float, _ Preconditioner: SparseOpaquePreconditioner_Complex_Float) -> SparseIterativeStatus_t
```

## Parameters

`method`

(input) Iterative method specification, eg return value of
`SparseConjugateGradient()`.

`ApplyOperator`

`ApplyOperator(accumulate, trans, X, Y)`
should perform the operation `Y = op(A)X` if `accumulate` is `false`,
or `Y += op(A)X` if `accumulate` is `true`.

- `accumulate` : (input) Indicates whether to perform `Y += op(A)X` (if
  true) or `Y = op(A)X` (if false).
- `trans`: (input) Indicates whether `op(A)` is the application of `A`
  (`trans=CblasNoTrans`) or `A^T` (`trans=CblasTrans`).
-  `x`: The vector to multiply.
-  `y`: The vector in which to accumulate or store the result.

`b`

The right-hand side `b` to solve for. If `a` has dimension `m x n`, then
`b` must have length `m`.

`x`

On entry, initial guess for solution, on return the solution. If `A`
has dimension `m x n`, then `x` must have length `n`. If no good initial
estimate is available, user should set the initial guess to be the
zero vector.

`Preconditioner`

(input) The preconditioner to use.

---

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)