solve¶
- UMFFactor.solve(b, A=None, *, trans='N')[source]¶
Solve a linear system using the LU factorization.
This method solves one of the following linear systems:
\(A x = b\) (if
trans='N')\(A^{\top} x = b\) (if
trans='T'and \(A\) is real)\(A^{H} x = b\) (if
trans='H'and \(A\) is complex)
The matrix \(A\) must have the same shape and nonzero pattern as the one used to create this
UMFFactorobject, but need not have the same values. No check is performed to ensure that the input matrix is compatible with the existing factorization.- Parameters:
b ((N,) numpy.ndarray or sparse array) – The right-hand side vector.
A ((N, N) numpy.ndarray or sparse array, optional) – The input matrix. Must have the same shape and nonzero pattern as the matrix used to create this
UMFFactorobject.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
TandHare equivalent.
- Returns:
x ((N,) or (N, K) numpy.ndarray or sparse array) – The solution vector or matrix. If
bis a 1D array, thenxis returned as a 1D array. Ifbis a 2D array withKcolumns, thenxis returned as a 2D array withKcolumns. Ifbis a sparse array, thenxis also returned as a sparse array.- 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.