Sub Ex_Zpotri()
Const N = 3
Dim A(N - 1, N - 1) As Complex, Info As Long
A(0, 0) = Cmplx(2.2, 0)
A(1, 0) = Cmplx(-0.11, -0.93): A(1, 1) = Cmplx(2.32, 0)
A(2, 0) = Cmplx(0.81, 0.37): A(2, 1) = Cmplx(-0.8, -0.92): A(2, 2) = Cmplx(2.29, 0)
Call
Zpotrf("L", N, A(), Info)
If Info = 0 Then Call Zpotri("L", N, A(), 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
Sub Zpotrf(Uplo As String, N As Long, A() As Complex, Info As Long)
Cholesky factorization of a Hermitian positive definite matrix