XLPack 6.1
Excel VBA Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ Zpttrf()

Sub Zpttrf ( N As  Long,
D() As  Double,
E() As  Complex,
Info As  Long 
)

LDLH factorization of a Hermitian positive definite tridiagonal matrix

Purpose
This routine computes the L*D*L^H factorization of a Hermitian positive definite tridiagonal matrix A. The factorization may also be regarded as having the form A = U^H*D*U.
Parameters
[in]NOrder of the matrix A. (N >= 0) (If N = 0, returns without computation)
[in,out]D()Array D(LD - 1) (LD >= N)
[in] N diagonal elements of the Hermitian positive definite tridiagonal matrix A.
[out] N diagonal elements of the diagonal matrix D from the factorization A = L*D*L^H.
[in,out]E()Array E(LE - 1) (LE >= N - 1)
[in] N-1 sub-diagonal elements of the Hermintian positive definite tridiagonal matrix A.
[out] N-1 sub-diagonal elements of the unit bidiagonal factor L from the L*D*L^H factorization of A. E can also be regarded as the super-diagonal of the unit bidiagonal factor U from the U^H*D*U factorization of A.
[out]Info= 0: Successful exit.
= -1: The argument N had an illegal value. (N < 0)
= -2: The argument D() is invalid.
= -3: The argument E() is invalid.
= i > 0: The leading minor of order i is not positive definite. If i < N, the factorization could not been completed, while if i = N, the factorization was completed, but D(N-1) <= 0.
Reference
LAPACK
Example Program
Solve the system of linear equations Ax = B and estimate the reciprocal of the condition number (RCond) of A, where
( 2.88 0.29-0.44i 0 )
A = ( 0.29+0.44i 0.62 -0.01-0.02i )
( 0 -0.01+0.02i 0.46 )
( 1.6236-0.7300i )
B = ( 0.1581+0.1537i )
( 0.1132-0.2290i )
Sub Ex_Zpttrf()
Const N As Long = 3
Dim D(N - 1) As Double, E(N - 2) As Complex, B(N - 1) As Complex
Dim ANorm As Double, RCond As Double, Info As Long
D(0) = 2.88: D(1) = 0.62: D(2) = 0.46
E(0) = Cmplx(0.29, 0.44): E(1) = Cmplx(-0.01, 0.02)
B(0) = Cmplx(1.6236, -0.73): B(1) = Cmplx(0.1581, 0.1537): B(2) = Cmplx(0.1132, -0.229)
ANorm = Zlanht("1", N, D(), E())
Call Zpttrf(N, D(), E(), Info)
If Info = 0 Then Call Zpttrs("L", N, D(), E(), B(), Info)
If Info = 0 Then Call Zptcon(N, D(), E(), ANorm, RCond, Info)
Debug.Print "X =",
Debug.Print Creal(B(0)), Cimag(B(0)), Creal(B(1)), Cimag(B(1)), Creal(B(2)), Cimag(B(2))
Debug.Print "RCond =", RCond
Debug.Print "Info =", Info
End Sub
Example Results
X = 0.59 -0.28 -0.2 -0.04 0.24 -0.49
RCond = 0.124521368143895
Info = 0