Developer Reference for Intel® oneAPI Math Kernel Library for C
?trtri
Computes the inverse of a triangular matrix.
Syntax
lapack_intLAPACKE_strtri ( intmatrix_layout , charuplo , chardiag , lapack_intn , float*a , lapack_intlda );
lapack_intLAPACKE_dtrtri ( intmatrix_layout , charuplo , chardiag , lapack_intn , double*a , lapack_intlda );
lapack_intLAPACKE_ctrtri ( intmatrix_layout , charuplo , chardiag , lapack_intn , lapack_complex_float*a , lapack_intlda );
lapack_intLAPACKE_ztrtri ( intmatrix_layout , charuplo , chardiag , lapack_intn , lapack_complex_double*a , lapack_intlda );
Include Files
mkl.h
Description
strtri dtrtri ctrtri ztrtri trtri
The routine computes the inverse inv(A) of a triangular matrix A .
Input Parameters
matrix_layout
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
uplo
Must be ‘U’ or ‘L’ .
Indicates whether A is upper or lower triangular:
If uplo = 'U' , then A is upper triangular.
If uplo = 'L' , then A is lower triangular.
diag
Must be ‘N’ or ‘U’ .
If diag = 'N' , then A is not a unit triangular matrix.
If diag = 'U' , A is unit triangular: diagonal elements of A are assumed to be 1 and not referenced in the array a .
n
The order of the matrix A ; n≥ 0 .
a
Array: . Contains the matrix A .
lda
The first dimension of a ; lda≥ max(1, n) .
Output Parameters
a
Overwritten by the matrix inv(A) .
Return Values
This function returns a value info .
If info = 0 , the execution is successful.
If info = -i , parameter i had an illegal value.
If info = i , the i -th diagonal element of A is zero, A is singular, and the inversion could not be completed.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
The computed inverse \(X\) satisfies the following error bounds:
\[|XA - I| \leq c(n)\varepsilon |X||A|\]
\[|XA - I| \leq c(n)\varepsilon |A^{-1}||A||X|,\]
where c(n) is a modest linear function of n ; \(\varepsilon\) is the machine precision; \(I\) denotes the identity matrix.
The total number of floating-point operations is approximately \((1/3)n^{3}\) for real flavors and \((4/3)n^{3}\) for complex flavors.