3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZHETRI2 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhetri2.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhetri2.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetri2.f">
21 * SUBROUTINE ZHETRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDA, LWORK, N
27 * .. Array Arguments ..
29 * COMPLEX*16 A( LDA, * ), WORK( * )
38 *> ZHETRI2 computes the inverse of a COMPLEX*16 hermitian indefinite matrix
39 *> A using the factorization A = U*D*U**T or A = L*D*L**T computed by
40 *> ZHETRF. ZHETRI2 set the LEADING DIMENSION of the workspace
41 *> before calling ZHETRI2X that actually computes the inverse.
49 *> UPLO is CHARACTER*1
50 *> Specifies whether the details of the factorization are stored
51 *> as an upper or lower triangular matrix.
52 *> = 'U': Upper triangular, form is A = U*D*U**T;
53 *> = 'L': Lower triangular, form is A = L*D*L**T.
59 *> The order of the matrix A. N >= 0.
64 *> A is COMPLEX*16 array, dimension (LDA,N)
65 *> On entry, the NB diagonal matrix D and the multipliers
66 *> used to obtain the factor U or L as computed by ZHETRF.
68 *> On exit, if INFO = 0, the (symmetric) inverse of the original
69 *> matrix. If UPLO = 'U', the upper triangular part of the
70 *> inverse is formed and the part of A below the diagonal is not
71 *> referenced; if UPLO = 'L' the lower triangular part of the
72 *> inverse is formed and the part of A above the diagonal is
79 *> The leading dimension of the array A. LDA >= max(1,N).
84 *> IPIV is INTEGER array, dimension (N)
85 *> Details of the interchanges and the NB structure of D
86 *> as determined by ZHETRF.
91 *> WORK is COMPLEX*16 array, dimension (N+NB+1)*(NB+3)
97 *> The dimension of the array WORK.
98 *> WORK is size >= (N+NB+1)*(NB+3)
99 *> If LWORK = -1, then a workspace query is assumed; the routine
101 *> - the optimal size of the WORK array, returns
102 *> this value as the first entry of the WORK array,
103 *> - and no error message related to LWORK is issued by XERBLA.
109 *> = 0: successful exit
110 *> < 0: if INFO = -i, the i-th argument had an illegal value
111 *> > 0: if INFO = i, D(i,i) = 0; the matrix is singular and its
112 *> inverse could not be computed.
118 *> \author Univ. of Tennessee
119 *> \author Univ. of California Berkeley
120 *> \author Univ. of Colorado Denver
123 *> \date November 2015
125 *> \ingroup complex16HEcomputational
127 * =====================================================================
128 SUBROUTINE ZHETRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
130 * -- LAPACK computational routine (version 3.6.0) --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
135 * .. Scalar Arguments ..
137 INTEGER INFO, LDA, LWORK, N
139 * .. Array Arguments ..
141 COMPLEX*16 A( LDA, * ), WORK( * )
144 * =====================================================================
146 * .. Local Scalars ..
147 LOGICAL UPPER, LQUERY
148 INTEGER MINSIZE, NBMAX
150 * .. External Functions ..
153 EXTERNAL LSAME, ILAENV
155 * .. External Subroutines ..
158 * .. Executable Statements ..
160 * Test the input parameters.
163 UPPER = LSAME( UPLO, 'U' )
164 LQUERY = ( LWORK.EQ.-1 )
166 NBMAX = ILAENV( 1, 'ZHETRF', UPLO, N, -1, -1, -1 )
167 IF ( NBMAX .GE. N ) THEN
170 MINSIZE = (N+NBMAX+1)*(NBMAX+3)
173 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
175 ELSE IF( N.LT.0 ) THEN
177 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
179 ELSE IF (LWORK .LT. MINSIZE .AND. .NOT.LQUERY ) THEN
183 * Quick return if possible
187 CALL XERBLA( 'ZHETRI2', -INFO )
189 ELSE IF( LQUERY ) THEN
196 IF( NBMAX .GE. N ) THEN
197 CALL ZHETRI( UPLO, N, A, LDA, IPIV, WORK, INFO )
199 CALL ZHETRI2X( UPLO, N, A, LDA, IPIV, WORK, NBMAX, INFO )