LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zpocon.f
Go to the documentation of this file.
1*> \brief \b ZPOCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZPOCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpocon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpocon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpocon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZPOCON( UPLO, N, A, LDA, ANORM, RCOND, WORK, RWORK,
20* INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* DOUBLE PRECISION RWORK( * )
29* COMPLEX*16 A( LDA, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> ZPOCON estimates the reciprocal of the condition number (in the
39*> 1-norm) of a complex Hermitian positive definite matrix using the
40*> Cholesky factorization A = U**H*U or A = L*L**H computed by ZPOTRF.
41*>
42*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
43*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
44*> \endverbatim
45*
46* Arguments:
47* ==========
48*
49*> \param[in] UPLO
50*> \verbatim
51*> UPLO is CHARACTER*1
52*> = 'U': Upper triangle of A is stored;
53*> = 'L': Lower triangle of A is stored.
54*> \endverbatim
55*>
56*> \param[in] N
57*> \verbatim
58*> N is INTEGER
59*> The order of the matrix A. N >= 0.
60*> \endverbatim
61*>
62*> \param[in] A
63*> \verbatim
64*> A is COMPLEX*16 array, dimension (LDA,N)
65*> The triangular factor U or L from the Cholesky factorization
66*> A = U**H*U or A = L*L**H, as computed by ZPOTRF.
67*> \endverbatim
68*>
69*> \param[in] LDA
70*> \verbatim
71*> LDA is INTEGER
72*> The leading dimension of the array A. LDA >= max(1,N).
73*> \endverbatim
74*>
75*> \param[in] ANORM
76*> \verbatim
77*> ANORM is DOUBLE PRECISION
78*> The 1-norm (or infinity-norm) of the Hermitian matrix A.
79*> \endverbatim
80*>
81*> \param[out] RCOND
82*> \verbatim
83*> RCOND is DOUBLE PRECISION
84*> The reciprocal of the condition number of the matrix A,
85*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
86*> estimate of the 1-norm of inv(A) computed in this routine.
87*> \endverbatim
88*>
89*> \param[out] WORK
90*> \verbatim
91*> WORK is COMPLEX*16 array, dimension (2*N)
92*> \endverbatim
93*>
94*> \param[out] RWORK
95*> \verbatim
96*> RWORK is DOUBLE PRECISION array, dimension (N)
97*> \endverbatim
98*>
99*> \param[out] INFO
100*> \verbatim
101*> INFO is INTEGER
102*> = 0: successful exit
103*> < 0: if INFO = -i, the i-th argument had an illegal value
104*> \endverbatim
105*
106* Authors:
107* ========
108*
109*> \author Univ. of Tennessee
110*> \author Univ. of California Berkeley
111*> \author Univ. of Colorado Denver
112*> \author NAG Ltd.
113*
114*> \ingroup pocon
115*
116* =====================================================================
117 SUBROUTINE zpocon( UPLO, N, A, LDA, ANORM, RCOND, WORK, RWORK,
118 $ INFO )
119*
120* -- LAPACK computational routine --
121* -- LAPACK is a software package provided by Univ. of Tennessee, --
122* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123*
124* .. Scalar Arguments ..
125 CHARACTER UPLO
126 INTEGER INFO, LDA, N
127 DOUBLE PRECISION ANORM, RCOND
128* ..
129* .. Array Arguments ..
130 DOUBLE PRECISION RWORK( * )
131 COMPLEX*16 A( LDA, * ), WORK( * )
132* ..
133*
134* =====================================================================
135*
136* .. Parameters ..
137 DOUBLE PRECISION ONE, ZERO
138 parameter( one = 1.0d+0, zero = 0.0d+0 )
139* ..
140* .. Local Scalars ..
141 LOGICAL UPPER
142 CHARACTER NORMIN
143 INTEGER IX, KASE
144 DOUBLE PRECISION AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
145 COMPLEX*16 ZDUM
146* ..
147* .. Local Arrays ..
148 INTEGER ISAVE( 3 )
149* ..
150* .. External Functions ..
151 LOGICAL LSAME
152 INTEGER IZAMAX
153 DOUBLE PRECISION DLAMCH
154 EXTERNAL lsame, izamax, dlamch
155* ..
156* .. External Subroutines ..
157 EXTERNAL xerbla, zdrscl, zlacn2, zlatrs
158* ..
159* .. Intrinsic Functions ..
160 INTRINSIC abs, dble, dimag, max
161* ..
162* .. Statement Functions ..
163 DOUBLE PRECISION CABS1
164* ..
165* .. Statement Function definitions ..
166 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
167* ..
168* .. Executable Statements ..
169*
170* Test the input parameters.
171*
172 info = 0
173 upper = lsame( uplo, 'U' )
174 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
175 info = -1
176 ELSE IF( n.LT.0 ) THEN
177 info = -2
178 ELSE IF( lda.LT.max( 1, n ) ) THEN
179 info = -4
180 ELSE IF( anorm.LT.zero ) THEN
181 info = -5
182 END IF
183 IF( info.NE.0 ) THEN
184 CALL xerbla( 'ZPOCON', -info )
185 RETURN
186 END IF
187*
188* Quick return if possible
189*
190 rcond = zero
191 IF( n.EQ.0 ) THEN
192 rcond = one
193 RETURN
194 ELSE IF( anorm.EQ.zero ) THEN
195 RETURN
196 END IF
197*
198 smlnum = dlamch( 'Safe minimum' )
199*
200* Estimate the 1-norm of inv(A).
201*
202 kase = 0
203 normin = 'N'
204 10 CONTINUE
205 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
206 IF( kase.NE.0 ) THEN
207 IF( upper ) THEN
208*
209* Multiply by inv(U**H).
210*
211 CALL zlatrs( 'Upper', 'Conjugate transpose', 'Non-unit',
212 $ normin, n, a, lda, work, scalel, rwork, info )
213 normin = 'Y'
214*
215* Multiply by inv(U).
216*
217 CALL zlatrs( 'Upper', 'No transpose', 'Non-unit', normin,
218 $ n,
219 $ a, lda, work, scaleu, rwork, info )
220 ELSE
221*
222* Multiply by inv(L).
223*
224 CALL zlatrs( 'Lower', 'No transpose', 'Non-unit', normin,
225 $ n,
226 $ a, lda, work, scalel, rwork, info )
227 normin = 'Y'
228*
229* Multiply by inv(L**H).
230*
231 CALL zlatrs( 'Lower', 'Conjugate transpose', 'Non-unit',
232 $ normin, n, a, lda, work, scaleu, rwork, info )
233 END IF
234*
235* Multiply by 1/SCALE if doing so will not cause overflow.
236*
237 scale = scalel*scaleu
238 IF( scale.NE.one ) THEN
239 ix = izamax( n, work, 1 )
240 IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
241 $ GO TO 20
242 CALL zdrscl( n, scale, work, 1 )
243 END IF
244 GO TO 10
245 END IF
246*
247* Compute the estimate of the reciprocal condition number.
248*
249 IF( ainvnm.NE.zero )
250 $ rcond = ( one / ainvnm ) / anorm
251*
252 20 CONTINUE
253 RETURN
254*
255* End of ZPOCON
256*
257 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
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
subroutine zlatrs(uplo, trans, diag, normin, n, a, lda, x, scale, cnorm, info)
ZLATRS solves a triangular system of equations with the scale factor set to prevent overflow.
Definition zlatrs.f:238
subroutine zpocon(uplo, n, a, lda, anorm, rcond, work, rwork, info)
ZPOCON
Definition zpocon.f:119
subroutine zdrscl(n, sa, sx, incx)
ZDRSCL multiplies a vector by the reciprocal of a real scalar.
Definition zdrscl.f:82