Contents

SparseSolve(_:_:_:_:)

Solves the system AX=B for X, using the supplied SparseOpaqueFactorization_Complex_Float of A, and without any internal memory allocations.

Declaration

func SparseSolve(_ Factored: SparseOpaqueFactorization_Complex_Float, _ B: DenseMatrix_Complex_Float, _ X: DenseMatrix_Complex_Float, _ workspace: UnsafeMutableRawPointer)

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.

  • workspace:

    Scratch space of size Factored.solveWorkspaceRequiredStatic + nrhs * Factored.solveWorkspaceRequiredPerRHS. This memory must be 16-byte aligned (any allocation returned by malloc() 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.

See Also

Complex matrix solving functions