LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zsycon_3.f
Go to the documentation of this file.
1*> \brief \b ZSYCON_3
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZSYCON_3 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsycon_3.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsycon_3.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsycon_3.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZSYCON_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*> ZSYCON_3 estimates the reciprocal of the condition number (in the
38*> 1-norm) of a complex symmetric matrix A using the factorization
39*> computed by ZSYTRF_RK or ZSYTRF_BK:
40*>
41*> A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
42*>
43*> where U (or L) is unit upper (or lower) triangular matrix,
44*> U**T (or L**T) is the transpose of U (or L), P is a permutation
45*> matrix, P**T is the transpose of P, and D is symmetric 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 ZSYTRS_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**T)*(P**T);
62*> = 'L': Lower triangular, form is A = P*L*D*(L**T)*(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 ZSYTRF_RK and ZSYTRF_BK:
76*> a) ONLY diagonal elements of the symmetric 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 symmetric 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 ZSYTRF_RK or ZSYTRF_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 zsycon_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 COMPLEX*16 CZERO
185 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
186* ..
187* .. Local Scalars ..
188 LOGICAL UPPER
189 INTEGER I, KASE
190 DOUBLE PRECISION AINVNM
191* ..
192* .. Local Arrays ..
193 INTEGER ISAVE( 3 )
194* ..
195* .. External Functions ..
196 LOGICAL LSAME
197 EXTERNAL lsame
198* ..
199* .. External Subroutines ..
200 EXTERNAL zlacn2, zsytrs_3, xerbla
201* ..
202* .. Intrinsic Functions ..
203 INTRINSIC max
204* ..
205* .. Executable Statements ..
206*
207* Test the input parameters.
208*
209 info = 0
210 upper = lsame( uplo, 'U' )
211 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
212 info = -1
213 ELSE IF( n.LT.0 ) THEN
214 info = -2
215 ELSE IF( lda.LT.max( 1, n ) ) THEN
216 info = -4
217 ELSE IF( anorm.LT.zero ) THEN
218 info = -7
219 END IF
220 IF( info.NE.0 ) THEN
221 CALL xerbla( 'ZSYCON_3', -info )
222 RETURN
223 END IF
224*
225* Quick return if possible
226*
227 rcond = zero
228 IF( n.EQ.0 ) THEN
229 rcond = one
230 RETURN
231 ELSE IF( anorm.LE.zero ) THEN
232 RETURN
233 END IF
234*
235* Check that the diagonal matrix D is nonsingular.
236*
237 IF( upper ) THEN
238*
239* Upper triangular storage: examine D from bottom to top
240*
241 DO i = n, 1, -1
242 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.czero )
243 $ RETURN
244 END DO
245 ELSE
246*
247* Lower triangular storage: examine D from top to bottom.
248*
249 DO i = 1, n
250 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.czero )
251 $ RETURN
252 END DO
253 END IF
254*
255* Estimate the 1-norm of the inverse.
256*
257 kase = 0
258 30 CONTINUE
259 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
260 IF( kase.NE.0 ) THEN
261*
262* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
263*
264 CALL zsytrs_3( uplo, n, 1, a, lda, e, ipiv, work, n, info )
265 GO TO 30
266 END IF
267*
268* Compute the estimate of the reciprocal condition number.
269*
270 IF( ainvnm.NE.zero )
271 $ rcond = ( one / ainvnm ) / anorm
272*
273 RETURN
274*
275* End of ZSYCON_3
276*
277 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zsycon_3(uplo, n, a, lda, e, ipiv, anorm, rcond, work, info)
ZSYCON_3
Definition zsycon_3.f:164
subroutine zsytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
ZSYTRS_3
Definition zsytrs_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