umf_solve

sksparse.umfpack.umf_solve(A, b, *, trans='N', control=None, **kwargs)[source]

Solve a linear system using UMFPACK.

This is a convenience function that creates a UMFFactor object, computes the numeric factorization, and solves the linear system.

Parameters:
  • A ((N, N) numpy.ndarray or sparse array) – The input matrix.

  • b ((N,) numpy.ndarray or sparse array) – The right-hand side vector.

  • trans (str, optional) – The type of system to solve. Possible values are:

    • N: solve \(A x = b\) (default)

    • T: solve \(A^{\top} x = b\)

    • H: solve \(A^{H} x = b\)

    Note

    If \(A\) is real, then T and H are equivalent.

  • control (UMFControl, optional) – The control parameters to use for the factorization. If not provided, default parameters are used.

  • kwargs (keyword arguments, optional) – Additional keyword arguments to pass to UMFControl if control is not provided.

Returns:

x ((N,) numpy.ndarray or sparse array) – The solution vector of the same type as the input right-hand side b.

Raises:

UMFPACKSingularMatrixWarning – If the matrix is detected to be singular to working precision. In that case, the solution will have infinite or NaN values, but other entries may still be valid.

Added in version 0.5.0.