LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
chetri2.f
Go to the documentation of this file.
1*> \brief \b CHETRI2
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CHETRI2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chetri2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chetri2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetri2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CHETRI2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO
23* INTEGER INFO, LDA, LWORK, N
24* ..
25* .. Array Arguments ..
26* INTEGER IPIV( * )
27* COMPLEX A( LDA, * ), WORK( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> CHETRI2 computes the inverse of a COMPLEX hermitian indefinite matrix
37*> A using the factorization A = U*D*U**T or A = L*D*L**T computed by
38*> CHETRF. CHETRI2 set the LEADING DIMENSION of the workspace
39*> before calling CHETRI2X that actually computes the inverse.
40*> \endverbatim
41*
42* Arguments:
43* ==========
44*
45*> \param[in] UPLO
46*> \verbatim
47*> UPLO is CHARACTER*1
48*> Specifies whether the details of the factorization are stored
49*> as an upper or lower triangular matrix.
50*> = 'U': Upper triangular, form is A = U*D*U**T;
51*> = 'L': Lower triangular, form is A = L*D*L**T.
52*> \endverbatim
53*>
54*> \param[in] N
55*> \verbatim
56*> N is INTEGER
57*> The order of the matrix A. N >= 0.
58*> \endverbatim
59*>
60*> \param[in,out] A
61*> \verbatim
62*> A is COMPLEX array, dimension (LDA,N)
63*> On entry, the block diagonal matrix D and the multipliers
64*> used to obtain the factor U or L as computed by CHETRF.
65*>
66*> On exit, if INFO = 0, the (symmetric) inverse of the original
67*> matrix. If UPLO = 'U', the upper triangular part of the
68*> inverse is formed and the part of A below the diagonal is not
69*> referenced; if UPLO = 'L' the lower triangular part of the
70*> inverse is formed and the part of A above the diagonal is
71*> not referenced.
72*> \endverbatim
73*>
74*> \param[in] LDA
75*> \verbatim
76*> LDA is INTEGER
77*> The leading dimension of the array A. LDA >= max(1,N).
78*> \endverbatim
79*>
80*> \param[in] IPIV
81*> \verbatim
82*> IPIV is INTEGER array, dimension (N)
83*> Details of the interchanges and the block structure of D
84*> as determined by CHETRF.
85*> \endverbatim
86*>
87*> \param[out] WORK
88*> \verbatim
89*> WORK is COMPLEX array, dimension (MAX(1,LWORK))
90*> \endverbatim
91*>
92*> \param[in] LWORK
93*> \verbatim
94*> LWORK is INTEGER
95*> The dimension of the array WORK.
96*> If N = 0, LWORK >= 1, else LWORK >= (N+NB+1)*(NB+3).
97*> If LWORK = -1, then a workspace query is assumed; the routine
98*> calculates:
99*> - the optimal size of the WORK array, returns
100*> this value as the first entry of the WORK array,
101*> - and no error message related to LWORK is issued by XERBLA.
102*> \endverbatim
103*>
104*> \param[out] INFO
105*> \verbatim
106*> INFO is INTEGER
107*> = 0: successful exit
108*> < 0: if INFO = -i, the i-th argument had an illegal value
109*> > 0: if INFO = i, D(i,i) = 0; the matrix is singular and its
110*> inverse could not be computed.
111*> \endverbatim
112*
113* Authors:
114* ========
115*
116*> \author Univ. of Tennessee
117*> \author Univ. of California Berkeley
118*> \author Univ. of Colorado Denver
119*> \author NAG Ltd.
120*
121*> \ingroup hetri2
122*
123* =====================================================================
124 SUBROUTINE chetri2( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
125*
126* -- LAPACK computational routine --
127* -- LAPACK is a software package provided by Univ. of Tennessee, --
128* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129*
130* .. Scalar Arguments ..
131 CHARACTER UPLO
132 INTEGER INFO, LDA, LWORK, N
133* ..
134* .. Array Arguments ..
135 INTEGER IPIV( * )
136 COMPLEX A( LDA, * ), WORK( * )
137* ..
138*
139* =====================================================================
140*
141* .. Local Scalars ..
142 LOGICAL UPPER, LQUERY
143 INTEGER MINSIZE, NBMAX
144* ..
145* .. External Functions ..
146 LOGICAL LSAME
147 INTEGER ILAENV
148 REAL SROUNDUP_LWORK
149 EXTERNAL lsame, ilaenv, sroundup_lwork
150* ..
151* .. External Subroutines ..
152 EXTERNAL chetri2x, chetri, xerbla
153* ..
154* .. Executable Statements ..
155*
156* Test the input parameters.
157*
158 info = 0
159 upper = lsame( uplo, 'U' )
160 lquery = ( lwork.EQ.-1 )
161*
162* Get blocksize
163*
164 nbmax = ilaenv( 1, 'CHETRF', uplo, n, -1, -1, -1 )
165 IF( n.EQ.0 ) THEN
166 minsize = 1
167 ELSE IF( nbmax.GE.n ) THEN
168 minsize = n
169 ELSE
170 minsize = (n+nbmax+1)*(nbmax+3)
171 END IF
172*
173 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174 info = -1
175 ELSE IF( n.LT.0 ) THEN
176 info = -2
177 ELSE IF( lda.LT.max( 1, n ) ) THEN
178 info = -4
179 ELSE IF( lwork.LT.minsize .AND. .NOT.lquery ) THEN
180 info = -7
181 END IF
182*
183 IF( info.NE.0 ) THEN
184 CALL xerbla( 'CHETRI2', -info )
185 RETURN
186 ELSE IF( lquery ) THEN
187 work( 1 ) = sroundup_lwork( minsize )
188 RETURN
189 END IF
190*
191* Quick return if possible
192*
193 IF( n.EQ.0 )
194 $ RETURN
195
196 IF( nbmax.GE.n ) THEN
197 CALL chetri( uplo, n, a, lda, ipiv, work, info )
198 ELSE
199 CALL chetri2x( uplo, n, a, lda, ipiv, work, nbmax, info )
200 END IF
201*
202 RETURN
203*
204* End of CHETRI2
205*
206 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine chetri2(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRI2
Definition chetri2.f:125
subroutine chetri2x(uplo, n, a, lda, ipiv, work, nb, info)
CHETRI2X
Definition chetri2x.f:118
subroutine chetri(uplo, n, a, lda, ipiv, work, info)
CHETRI
Definition chetri.f:112