LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zpocon()

subroutine zpocon ( character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
double precision anorm,
double precision rcond,
complex*16, dimension( * ) work,
double precision, dimension( * ) rwork,
integer info )

ZPOCON

Download ZPOCON + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZPOCON estimates the reciprocal of the condition number (in the
!> 1-norm) of a complex Hermitian positive definite matrix using the
!> Cholesky factorization A = U**H*U or A = L*L**H computed by ZPOTRF.
!>
!> An estimate is obtained for norm(inv(A)), and the reciprocal of the
!> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          The triangular factor U or L from the Cholesky factorization
!>          A = U**H*U or A = L*L**H, as computed by ZPOTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]ANORM
!>          ANORM is DOUBLE PRECISION
!>          The 1-norm (or infinity-norm) of the Hermitian matrix A.
!> 
[out]RCOND
!>          RCOND is DOUBLE PRECISION
!>          The reciprocal of the condition number of the matrix A,
!>          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
!>          estimate of the 1-norm of inv(A) computed in this routine.
!> 
[out]WORK
!>          WORK is COMPLEX*16 array, dimension (2*N)
!> 
[out]RWORK
!>          RWORK is DOUBLE PRECISION array, dimension (N)
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 117 of file zpocon.f.

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*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function izamax(n, zx, incx)
IZAMAX
Definition izamax.f:71
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
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zdrscl(n, sa, sx, incx)
ZDRSCL multiplies a vector by the reciprocal of a real scalar.
Definition zdrscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: