LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zhecon_3.f
Go to the documentation of this file.
1*> \brief \b ZHECON_3
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZHECON_3 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhecon_3.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhecon_3.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhecon_3.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZHECON_3( UPLO, N, A, LDA, E, IPIV, ANORM, RCOND,
20* WORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX*16 A( LDA, * ), E ( * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*> ZHECON_3 estimates the reciprocal of the condition number (in the
38*> 1-norm) of a complex Hermitian matrix A using the factorization
39*> computed by ZHETRF_RK or ZHETRF_BK:
40*>
41*> A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
42*>
43*> where U (or L) is unit upper (or lower) triangular matrix,
44*> U**H (or L**H) is the conjugate of U (or L), P is a permutation
45*> matrix, P**T is the transpose of P, and D is Hermitian and block
46*> diagonal with 1-by-1 and 2-by-2 diagonal blocks.
47*>
48*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
49*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
50*> This routine uses BLAS3 solver ZHETRS_3.
51*> \endverbatim
52*
53* Arguments:
54* ==========
55*
56*> \param[in] UPLO
57*> \verbatim
58*> UPLO is CHARACTER*1
59*> Specifies whether the details of the factorization are
60*> stored as an upper or lower triangular matrix:
61*> = 'U': Upper triangular, form is A = P*U*D*(U**H)*(P**T);
62*> = 'L': Lower triangular, form is A = P*L*D*(L**H)*(P**T).
63*> \endverbatim
64*>
65*> \param[in] N
66*> \verbatim
67*> N is INTEGER
68*> The order of the matrix A. N >= 0.
69*> \endverbatim
70*>
71*> \param[in] A
72*> \verbatim
73*> A is COMPLEX*16 array, dimension (LDA,N)
74*> Diagonal of the block diagonal matrix D and factors U or L
75*> as computed by ZHETRF_RK and ZHETRF_BK:
76*> a) ONLY diagonal elements of the Hermitian block diagonal
77*> matrix D on the diagonal of A, i.e. D(k,k) = A(k,k);
78*> (superdiagonal (or subdiagonal) elements of D
79*> should be provided on entry in array E), and
80*> b) If UPLO = 'U': factor U in the superdiagonal part of A.
81*> If UPLO = 'L': factor L in the subdiagonal part of A.
82*> \endverbatim
83*>
84*> \param[in] LDA
85*> \verbatim
86*> LDA is INTEGER
87*> The leading dimension of the array A. LDA >= max(1,N).
88*> \endverbatim
89*>
90*> \param[in] E
91*> \verbatim
92*> E is COMPLEX*16 array, dimension (N)
93*> On entry, contains the superdiagonal (or subdiagonal)
94*> elements of the Hermitian block diagonal matrix D
95*> with 1-by-1 or 2-by-2 diagonal blocks, where
96*> If UPLO = 'U': E(i) = D(i-1,i),i=2:N, E(1) not referenced;
97*> If UPLO = 'L': E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.
98*>
99*> NOTE: For 1-by-1 diagonal block D(k), where
100*> 1 <= k <= N, the element E(k) is not referenced in both
101*> UPLO = 'U' or UPLO = 'L' cases.
102*> \endverbatim
103*>
104*> \param[in] IPIV
105*> \verbatim
106*> IPIV is INTEGER array, dimension (N)
107*> Details of the interchanges and the block structure of D
108*> as determined by ZHETRF_RK or ZHETRF_BK.
109*> \endverbatim
110*>
111*> \param[in] ANORM
112*> \verbatim
113*> ANORM is DOUBLE PRECISION
114*> The 1-norm of the original matrix A.
115*> \endverbatim
116*>
117*> \param[out] RCOND
118*> \verbatim
119*> RCOND is DOUBLE PRECISION
120*> The reciprocal of the condition number of the matrix A,
121*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
122*> estimate of the 1-norm of inv(A) computed in this routine.
123*> \endverbatim
124*>
125*> \param[out] WORK
126*> \verbatim
127*> WORK is COMPLEX*16 array, dimension (2*N)
128*> \endverbatim
129*>
130*> \param[out] INFO
131*> \verbatim
132*> INFO is INTEGER
133*> = 0: successful exit
134*> < 0: if INFO = -i, the i-th argument had an illegal value
135*> \endverbatim
136*
137* Authors:
138* ========
139*
140*> \author Univ. of Tennessee
141*> \author Univ. of California Berkeley
142*> \author Univ. of Colorado Denver
143*> \author NAG Ltd.
144*
145*> \ingroup hecon_3
146*
147*> \par Contributors:
148* ==================
149*> \verbatim
150*>
151*> June 2017, Igor Kozachenko,
152*> Computer Science Division,
153*> University of California, Berkeley
154*>
155*> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
156*> School of Mathematics,
157*> University of Manchester
158*>
159*> \endverbatim
160*
161* =====================================================================
162 SUBROUTINE zhecon_3( UPLO, N, A, LDA, E, IPIV, ANORM, RCOND,
163 $ WORK, INFO )
164*
165* -- LAPACK computational routine --
166* -- LAPACK is a software package provided by Univ. of Tennessee, --
167* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
168*
169* .. Scalar Arguments ..
170 CHARACTER UPLO
171 INTEGER INFO, LDA, N
172 DOUBLE PRECISION ANORM, RCOND
173* ..
174* .. Array Arguments ..
175 INTEGER IPIV( * )
176 COMPLEX*16 A( LDA, * ), E( * ), WORK( * )
177* ..
178*
179* =====================================================================
180*
181* .. Parameters ..
182 DOUBLE PRECISION ONE, ZERO
183 parameter( one = 1.0d+0, zero = 0.0d+0 )
184* ..
185* .. Local Scalars ..
186 LOGICAL UPPER
187 INTEGER I, KASE
188 DOUBLE PRECISION AINVNM
189* ..
190* .. Local Arrays ..
191 INTEGER ISAVE( 3 )
192* ..
193* .. External Functions ..
194 LOGICAL LSAME
195 EXTERNAL lsame
196* ..
197* .. External Subroutines ..
198 EXTERNAL zhetrs_3, zlacn2, xerbla
199* ..
200* .. Intrinsic Functions ..
201 INTRINSIC max
202* ..
203* .. Executable Statements ..
204*
205* Test the input parameters.
206*
207 info = 0
208 upper = lsame( uplo, 'U' )
209 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
210 info = -1
211 ELSE IF( n.LT.0 ) THEN
212 info = -2
213 ELSE IF( lda.LT.max( 1, n ) ) THEN
214 info = -4
215 ELSE IF( anorm.LT.zero ) THEN
216 info = -7
217 END IF
218 IF( info.NE.0 ) THEN
219 CALL xerbla( 'ZHECON_3', -info )
220 RETURN
221 END IF
222*
223* Quick return if possible
224*
225 rcond = zero
226 IF( n.EQ.0 ) THEN
227 rcond = one
228 RETURN
229 ELSE IF( anorm.LE.zero ) THEN
230 RETURN
231 END IF
232*
233* Check that the diagonal matrix D is nonsingular.
234*
235 IF( upper ) THEN
236*
237* Upper triangular storage: examine D from bottom to top
238*
239 DO i = n, 1, -1
240 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
241 $ RETURN
242 END DO
243 ELSE
244*
245* Lower triangular storage: examine D from top to bottom.
246*
247 DO i = 1, n
248 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
249 $ RETURN
250 END DO
251 END IF
252*
253* Estimate the 1-norm of the inverse.
254*
255 kase = 0
256 30 CONTINUE
257 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
258 IF( kase.NE.0 ) THEN
259*
260* Multiply by inv(L*D*L**H) or inv(U*D*U**H).
261*
262 CALL zhetrs_3( uplo, n, 1, a, lda, e, ipiv, work, n, info )
263 GO TO 30
264 END IF
265*
266* Compute the estimate of the reciprocal condition number.
267*
268 IF( ainvnm.NE.zero )
269 $ rcond = ( one / ainvnm ) / anorm
270*
271 RETURN
272*
273* End of ZHECON_3
274*
275 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zhecon_3(uplo, n, a, lda, e, ipiv, anorm, rcond, work, info)
ZHECON_3
Definition zhecon_3.f:164
subroutine zhetrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
ZHETRS_3
Definition zhetrs_3.f:163
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition zlacn2.f:131