SparseSolve(_:_:_:)
Solves the system Ax=b for x, using the supplied SparseOpaqueFactorization_Complex_Float of A, in place.
Declaration
func SparseSolve(_ Factored: SparseOpaqueFactorization_Complex_Float, _ xb: DenseVector_Complex_Float, _ workspace: UnsafeMutableRawPointer)Parameters
- Factored:
A factorization of
A. - xb:
On entry, the right-hand side
b. On return, the solution vectorx. IfAhas dimensionm x n, thenxbmust have lengthk, wherek=max(m,n). - workspace:
Scratch space of size
Factored.solveWorkspaceRequiredStatic + 1*Factored.solveWorkspaceRequiredPerRHS * 2. This memory must be 16-byte aligned (any allocation returned bymalloc()has this property).
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.