XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Dtptri()

Sub Dtptri ( Uplo As  String,
Diag As  String,
N As  Long,
Ap() As  Double,
Info As  Long 
)

Inverse of a triangular matrix in packed form

Purpose
This routine computes the inverse of a real upper or lower triangular matrix A stored in packed form.
Parameters
[in]Uplo= "U": A is upper triangular.
= "L": A is lower triangular.
[in]Diag= "N": A is non-unit triangular.
= "U": A is unit triangular. (Diagonal elements of Ap() are not referenced and are assumed to be 1)
[in]NOrder of the matrix A. (N >= 0) (If N = 0, returns without computation)
[in]Ap()Array Ap(LAp - 1) (LAp >= N(N + 1)/2)
[in] N x N triangular matrix A in packed symmetric matrix form. Upper or lower part is to be stored in accordance with Uplo.
[out] The (triangular) inverse of the original matrix, in the same packed form.
[out]Info= 0: Successful exit.
= -1: The argument Uplo had an illegal value. (Uplo <> "U" nor "L")
= -2: The argument Diag had an illegal value. (Diag <> "N" nor "U")
= -3: The argument N had an illegal value. (N < 0)
= -4: The argument Ap() is invalid.
= i > 0: The i-th diagonal element of A is exactly zero. The triangular matrix is singular and its inverse can not be computed.
Reference
LAPACK
Example Program
Compute the inverse matrix of A, where
( -1.13 0 0 )
A = ( 0.26 -1.98 0 )
( -0.96 0.30 -2.32 )
Sub Ex_Dtptri()
Const N = 3
Dim Ap(N * (N + 1) / 2) As Double, Info As Long
Ap(0) = -1.13
Ap(1) = 0.26: Ap(3) = -1.98
Ap(2) = -0.96: Ap(4) = 0.3: Ap(5) = -2.32
Call Dtptri("L", "N", N, Ap(), Info)
Debug.Print "Inv(A) ="
Debug.Print Ap(0)
Debug.Print Ap(1), Ap(3)
Debug.Print Ap(2), Ap(4), Ap(5)
Debug.Print "Info =", Info
End Sub
Sub Dtptri(Uplo As String, Diag As String, N As Long, Ap() As Double, Info As Long)
Inverse of a triangular matrix in packed form
Example Results
Inv(A) =
-0.884955752212389 0 0
-0.116206310896576 -0.505050505050505 0
0.35116190898919 -6.53082549634274E-02 -0.431034482758621
Info = 0