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

◆ Zsytri()

Sub Zsytri ( Uplo As  String,
N As  Long,
A() As  Complex,
IPiv() As  Long,
Info As  Long 
)

Inverse of a complex symmetric matrix

Purpose
This routine computes the inverse of a complex symmetric matrix A using the factorization A = U*D*U^T or A = L*D*L^T computed by Zsytrf.
Parameters
[in]UploSpecifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= "U": Upper triangular, form is A = U*D*U^T.
= "L": Lower triangular, form is A = L*D*L^T.
[in]NOrder of the matrix A. (N >= 0) (If N = 0, returns without computation)
[in]A()Array A(LA1 - 1, LA2 - 1) (LA1 >= N, LA2 >= N)
[in] The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by Zsytrf.
[out] If Info = 0, the (symmetric) inverse of the original matrix A. The upper or lower triangular part of the inverse is formed and the other part of A() below or above the diagonal is not referenced in accordance with Uplo.
[in]IPiv()Array IPiv(LIPiv - 1) (LIPiv >= N)
Details of the interchanges and the block structure of D as determined by Zsytrf.
[out]Info= 0: Successful exit.
= -1: The argument Uplo had an illegal value. (Uplo <> "U" nor "L")
= -2: The argument N had an illegal value. (N < 0)
= -3: The argument A() is invalid.
= -4: The argument IPiv() is invalid.
= i > 0: The i-th element of D is exactly zero; the matrix is singular and its inverse could not be computed.
Reference
LAPACK
Example Program
Compute the inverse matrix of A, where
( 0.20-0.11i -0.93-0.32i -0.80-0.92i )
A = ( -0.93-0.32i 0.81+0.37i -0.29+0.86i )
( -0.80-0.92i -0.29+0.86i 0.64+0.51i )
Sub Ex_Zsytri()
Const N = 3
Dim A(N - 1, N - 1) As Complex, IPiv(N - 1) As Long, Info As Long
A(0, 0) = Cmplx(0.2, -0.11)
A(1, 0) = Cmplx(-0.93, -0.32): A(1, 1) = Cmplx(0.81, 0.37)
A(2, 0) = Cmplx(-0.8, -0.92): A(2, 1) = Cmplx(-0.29, 0.86): A(2, 2) = Cmplx(0.64, 0.51)
Call Zsytrf("L", N, A(), IPiv(), Info)
If Info = 0 Then Call Zsytri("L", N, A(), IPiv(), Info)
Debug.Print "Inv(A) ="
Debug.Print Creal(A(0, 0)), Cimag(A(0, 0)), Creal(A(0, 1)), Cimag(A(0, 1))
Debug.Print Creal(A(0, 2)), Cimag(A(0, 2))
Debug.Print Creal(A(1, 0)), Cimag(A(1, 0)), Creal(A(1, 1)), Cimag(A(1, 1))
Debug.Print Creal(A(1, 2)), Cimag(A(1, 2))
Debug.Print Creal(A(2, 0)), Cimag(A(2, 0)), Creal(A(2, 1)), Cimag(A(2, 1))
Debug.Print Creal(A(2, 2)), Cimag(A(2, 2))
Debug.Print "Info =", Info
End Sub
Example Results
Inv(A) =
-0.719227845649432 2.10409854531818E-02 0 0
0 0
-0.530264806881645 0.461068985285655 0.415967871341667 0.574878197201315
0 0
-0.378362108041106 0.215383726745448 -0.459100384344751 -0.118538953519092
0.392991440632119 -2.46277479810784E-02
Info = 0