1       SUBROUTINE ZPOTRI( UPLO, N, A, LDA, INFO )
 2 *
 3 *  -- LAPACK routine (version 3.3.1) --
 4 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 5 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 6 *  -- April 2011                                                      --
 7 *
 8 *     .. Scalar Arguments ..
 9       CHARACTER          UPLO
10       INTEGER            INFO, LDA, N
11 *     ..
12 *     .. Array Arguments ..
13       COMPLEX*16         A( LDA, * )
14 *     ..
15 *
16 *  Purpose
17 *  =======
18 *
19 *  ZPOTRI computes the inverse of a complex Hermitian positive definite
20 *  matrix A using the Cholesky factorization A = U**H*U or A = L*L**H
21 *  computed by ZPOTRF.
22 *
23 *  Arguments
24 *  =========
25 *
26 *  UPLO    (input) CHARACTER*1
27 *          = 'U':  Upper triangle of A is stored;
28 *          = 'L':  Lower triangle of A is stored.
29 *
30 *  N       (input) INTEGER
31 *          The order of the matrix A.  N >= 0.
32 *
33 *  A       (input/output) COMPLEX*16 array, dimension (LDA,N)
34 *          On entry, the triangular factor U or L from the Cholesky
35 *          factorization A = U**H*U or A = L*L**H, as computed by
36 *          ZPOTRF.
37 *          On exit, the upper or lower triangle of the (Hermitian)
38 *          inverse of A, overwriting the input factor U or L.
39 *
40 *  LDA     (input) INTEGER
41 *          The leading dimension of the array A.  LDA >= max(1,N).
42 *
43 *  INFO    (output) INTEGER
44 *          = 0:  successful exit
45 *          < 0:  if INFO = -i, the i-th argument had an illegal value
46 *          > 0:  if INFO = i, the (i,i) element of the factor U or L is
47 *                zero, and the inverse could not be computed.
48 *
49 *  =====================================================================
50 *
51 *     .. External Functions ..
52       LOGICAL            LSAME
53       EXTERNAL           LSAME
54 *     ..
55 *     .. External Subroutines ..
56       EXTERNAL           XERBLA, ZLAUUM, ZTRTRI
57 *     ..
58 *     .. Intrinsic Functions ..
59       INTRINSIC          MAX
60 *     ..
61 *     .. Executable Statements ..
62 *
63 *     Test the input parameters.
64 *
65       INFO = 0
66       IF.NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
67          INFO = -1
68       ELSE IF( N.LT.0 ) THEN
69          INFO = -2
70       ELSE IF( LDA.LT.MAX1, N ) ) THEN
71          INFO = -4
72       END IF
73       IF( INFO.NE.0 ) THEN
74          CALL XERBLA( 'ZPOTRI'-INFO )
75          RETURN
76       END IF
77 *
78 *     Quick return if possible
79 *
80       IF( N.EQ.0 )
81      $   RETURN
82 *
83 *     Invert the triangular Cholesky factor U or L.
84 *
85       CALL ZTRTRI( UPLO, 'Non-unit', N, A, LDA, INFO )
86       IF( INFO.GT.0 )
87      $   RETURN
88 *
89 *     Form inv(U) * inv(U)**H or inv(L)**H * inv(L).
90 *
91       CALL ZLAUUM( UPLO, N, A, LDA, INFO )
92 *
93       RETURN
94 *
95 *     End of ZPOTRI
96 *
97       END