---
title: "SparseSolve(_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/sparsesolve(_:_:_:)-2rk1c"
---

# SparseSolve(_:_:_:)

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

## Declaration

```swift
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

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.

## See Also

### Complex matrix solving functions

- [SparseSolve(_:_:)](accelerate/sparsesolve(_:_:)-31yj7.md)
- [SparseSolve(_:_:)](accelerate/sparsesolve(_:_:)-3x0vj.md)
- [SparseSolve(_:_:)](accelerate/sparsesolve(_:_:)-4j17a.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-2qlwo.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-34okt.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-48njk.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-6pudz.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-7krer.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-7qdpl.md)
- [SparseSolve(_:_:_:)](accelerate/sparsesolve(_:_:_:)-8ikjb.md)
- [SparseSolve(_:_:_:_:)](accelerate/sparsesolve(_:_:_:_:)-5xn6p.md)
- [SparseSolve(_:_:_:_:)](accelerate/sparsesolve(_:_:_:_:)-6demt.md)
- [SparseSolve(_:_:_:_:)](accelerate/sparsesolve(_:_:_:_:)-6od6k.md)
- [SparseSolve(_:_:_:_:)](accelerate/sparsesolve(_:_:_:_:)-7mtyx.md)
