<!--
{
  "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(_:_:_:_:)-6afcf",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseSolve#$@SA@SparseOpaqueSubfactor_Complex_Float#$@SA@DenseMatrix_Complex_Float#S1_#*v#"
  },
  "title" : "SparseSolve(_:_:_:_:)"
}
-->

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

Solve the equation `Subfactor * X = B` for the matrix `X` of complex float values.

```
func SparseSolve(_ Subfactor: SparseOpaqueSubfactor_Complex_Float, _ B: DenseMatrix_Complex_Float, _ X: DenseMatrix_Complex_Float, _ workspace: UnsafeMutableRawPointer)
```

## Parameters

`Subfactor`

(input) The subfactor to solve a system involving, as returned by
`SparseCreateSubfactor()`.

`B`

(input) The right-hand sides `B`. If `Subfactor` is `m x n`, then `B` must
have dimension `m x nrhs`, where `nrhs` is the number of right-hand
sides.

`X`

(output) The solutions `X`. If `Subfactor` is `m x n`, and `B` is `m x nrhs`,
then `X` must have dimension `n x nrhs`.

`workspace`

(scratch) A workspace of size
`Subfactor.workspaceRequiredStatic + nrhs * Subfactor.workspaceRequiredPerRHS * 2`.
This memory must be 16-byte aligned (any allocation returned
by `malloc()` has this property).

---

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)