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

◆ cpocon()

subroutine cpocon ( character uplo,
integer n,
complex, dimension( lda, * ) a,
integer lda,
real anorm,
real rcond,
complex, dimension( * ) work,
real, dimension( * ) rwork,
integer info )

CPOCON

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

Purpose:
!>
!> CPOCON 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 CPOTRF.
!>
!> 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 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 CPOTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]ANORM
!>          ANORM is REAL
!>          The 1-norm (or infinity-norm) of the Hermitian matrix A.
!> 
[out]RCOND
!>          RCOND is REAL
!>          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 array, dimension (2*N)
!> 
[out]RWORK
!>          RWORK is REAL 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 cpocon.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 REAL ANORM, RCOND
128* ..
129* .. Array Arguments ..
130 REAL RWORK( * )
131 COMPLEX A( LDA, * ), WORK( * )
132* ..
133*
134* =====================================================================
135*
136* .. Parameters ..
137 REAL ONE, ZERO
138 parameter( one = 1.0e+0, zero = 0.0e+0 )
139* ..
140* .. Local Scalars ..
141 LOGICAL UPPER
142 CHARACTER NORMIN
143 INTEGER IX, KASE
144 REAL AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
145 COMPLEX ZDUM
146* ..
147* .. Local Arrays ..
148 INTEGER ISAVE( 3 )
149* ..
150* .. External Functions ..
151 LOGICAL LSAME
152 INTEGER ICAMAX
153 REAL SLAMCH
154 EXTERNAL lsame, icamax, slamch
155* ..
156* .. External Subroutines ..
157 EXTERNAL clacn2, clatrs, csrscl, xerbla
158* ..
159* .. Intrinsic Functions ..
160 INTRINSIC abs, aimag, max, real
161* ..
162* .. Statement Functions ..
163 REAL CABS1
164* ..
165* .. Statement Function definitions ..
166 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( 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( 'CPOCON', -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 = slamch( 'Safe minimum' )
199*
200* Estimate the 1-norm of inv(A).
201*
202 kase = 0
203 normin = 'N'
204 10 CONTINUE
205 CALL clacn2( 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 clatrs( '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 clatrs( '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 clatrs( '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 clatrs( '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 = icamax( n, work, 1 )
240 IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
241 $ GO TO 20
242 CALL csrscl( 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 CPOCON
256*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function icamax(n, cx, incx)
ICAMAX
Definition icamax.f:71
subroutine clacn2(n, v, x, est, kase, isave)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition clacn2.f:131
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
subroutine clatrs(uplo, trans, diag, normin, n, a, lda, x, scale, cnorm, info)
CLATRS solves a triangular system of equations with the scale factor set to prevent overflow.
Definition clatrs.f:238
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine csrscl(n, sa, sx, incx)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
Definition csrscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: