<!--
{
  "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(_:_:_:)-2rk1c",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseSolve#$@SA@SparseOpaqueFactorization_Complex_Double#$@SA@DenseMatrix_Complex_Double#S1_#"
  },
  "title" : "SparseSolve(_:_:_:)"
}
-->

# SparseSolve(_:_:_:)

Solves the system `AX=B` for `X`, using the supplied `SparseOpaqueFactorization_Complex_Double`
of A`,` in place.

```
func SparseSolve(_ Factored: SparseOpaqueFactorization_Complex_Double, _ B: DenseMatrix_Complex_Double, _ X: DenseMatrix_Complex_Double)
```

## Parameters

`Factored`

A factorization of `A`.

`B`

The right-hand sides `B` to solve for. If `A` has dimension `m x n`, then
`B` must have dimension `m x nrhs`, where nrhs is the number of
right-hand sides to find solutions for.

`X`

Matrix in which to return solutions. If `A` has dimension `m x n`, and
`B` has dimension `m x nrhs`, then `X` must have dimension `n x nrhs`.

## Discussion

If the factorization is `A=QR` and the system is underdetermined,
the solution of minimum norm `|| x ||_2` is returned.
If the factorization is A=QR and the system is overdetermined, the least
squares solution `arg min_x || Ax - b ||_2` is returned.
In the case of a factorization of `type=SparseCholeskyAtA`, the factorization
is in fact of `A^T A`, so the solution returned is for the system `A^TAx=b`.

---

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)