Content |
Computing the Inverse of a Matrix (tri)
tri (defined in namespace flens::lapack) computes the inverse of a matrix \(A\). For the computation of \(A^{-1}\) two variants are provided:
-
For a general \(n \times n\) matrix \(A\) containing the \(LU\) factorization computed by trf.
-
For a triangular matrix \(A\).
For convenience further sub-variants are provided that implicitly create temporary workspaces.
Inversion of a General Matrix
For \(A\) containing the \(LU\) factorization this method inverts \(U\) and then computes \(A^{-1}\) by solving the system \(A^{-1} L = U^{-1}\) for \(A^{-1}\).
Real Variant
|
A |
(input/output) real valued GeMatrix |
|
piv |
(input) integer valued DenseVector |
|
work |
(input) real valued DenseVector Note: If \(work\) has length zero the optimal length gets computed and vector \(work\) gets resized. Opposed to the worksize queries in LAPACK the function does not stop after computing the worksize. Instead it will continue the computation with the resized workspace. |
Return value:
|
\(i=0\) |
Successfull exit. |
|
\(i>0\) |
\(U_{i,i}\) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed. |
Complex Variant
|
A |
(input/output) complex valued GeMatrix |
|
piv |
(input) integer valued DenseVector |
|
work |
(input) complex valued DenseVector Note: If \(work\) has length zero the optimal length gets computed and vector \(work\) gets resized. Opposed to the worksize queries in LAPACK the function does not stop after computing the worksize. Instead it will continue the computation with the resized workspace. |
Return value:
|
\(i=0\) |
Successfull exit. |
|
\(i>0\) |
\(U_{i,i}\) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed. |
Variant with Implicit Workspace Creation
This variant implicitly creates a temporary workspace and calls the real or complex variant.
|
A |
(input/output) real or complex valued GeMatrix |
|
piv |
(input) integer valued DenseVector |
Inversion of a Triangular Matrix
Real Variant
|
A |
(input/output) real valued TrMatrix |
Complex Variant
|
A |
(input/output) complex valued TrMatrix |
Notes
-
Examples: lapack-getri and lapack-trtri.
-
trs is a port of dgetri, zgetri, dtrtri and ztrtri. Also this documentation is taken from there.