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

◆ cppcon()

subroutine cppcon ( character uplo,
integer n,
complex, dimension( * ) ap,
real anorm,
real rcond,
complex, dimension( * ) work,
real, dimension( * ) rwork,
integer info )

CPPCON

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

Purpose:
!>
!> CPPCON estimates the reciprocal of the condition number (in the
!> 1-norm) of a complex Hermitian positive definite packed matrix using
!> the Cholesky factorization A = U**H*U or A = L*L**H computed by
!> CPPTRF.
!>
!> 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]AP
!>          AP is COMPLEX array, dimension (N*(N+1)/2)
!>          The triangular factor U or L from the Cholesky factorization
!>          A = U**H*U or A = L*L**H, packed columnwise in a linear
!>          array.  The j-th column of U or L is stored in the array AP
!>          as follows:
!>          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
!>          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=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 115 of file cppcon.f.

117*
118* -- LAPACK computational routine --
119* -- LAPACK is a software package provided by Univ. of Tennessee, --
120* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
121*
122* .. Scalar Arguments ..
123 CHARACTER UPLO
124 INTEGER INFO, N
125 REAL ANORM, RCOND
126* ..
127* .. Array Arguments ..
128 REAL RWORK( * )
129 COMPLEX AP( * ), WORK( * )
130* ..
131*
132* =====================================================================
133*
134* .. Parameters ..
135 REAL ONE, ZERO
136 parameter( one = 1.0e+0, zero = 0.0e+0 )
137* ..
138* .. Local Scalars ..
139 LOGICAL UPPER
140 CHARACTER NORMIN
141 INTEGER IX, KASE
142 REAL AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
143 COMPLEX ZDUM
144* ..
145* .. Local Arrays ..
146 INTEGER ISAVE( 3 )
147* ..
148* .. External Functions ..
149 LOGICAL LSAME
150 INTEGER ICAMAX
151 REAL SLAMCH
152 EXTERNAL lsame, icamax, slamch
153* ..
154* .. External Subroutines ..
155 EXTERNAL clacn2, clatps, csrscl, xerbla
156* ..
157* .. Intrinsic Functions ..
158 INTRINSIC abs, aimag, real
159* ..
160* .. Statement Functions ..
161 REAL CABS1
162* ..
163* .. Statement Function definitions ..
164 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
165* ..
166* .. Executable Statements ..
167*
168* Test the input parameters.
169*
170 info = 0
171 upper = lsame( uplo, 'U' )
172 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
173 info = -1
174 ELSE IF( n.LT.0 ) THEN
175 info = -2
176 ELSE IF( anorm.LT.zero ) THEN
177 info = -4
178 END IF
179 IF( info.NE.0 ) THEN
180 CALL xerbla( 'CPPCON', -info )
181 RETURN
182 END IF
183*
184* Quick return if possible
185*
186 rcond = zero
187 IF( n.EQ.0 ) THEN
188 rcond = one
189 RETURN
190 ELSE IF( anorm.EQ.zero ) THEN
191 RETURN
192 END IF
193*
194 smlnum = slamch( 'Safe minimum' )
195*
196* Estimate the 1-norm of the inverse.
197*
198 kase = 0
199 normin = 'N'
200 10 CONTINUE
201 CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
202 IF( kase.NE.0 ) THEN
203 IF( upper ) THEN
204*
205* Multiply by inv(U**H).
206*
207 CALL clatps( 'Upper', 'Conjugate transpose', 'Non-unit',
208 $ normin, n, ap, work, scalel, rwork, info )
209 normin = 'Y'
210*
211* Multiply by inv(U).
212*
213 CALL clatps( 'Upper', 'No transpose', 'Non-unit', normin,
214 $ n,
215 $ ap, work, scaleu, rwork, info )
216 ELSE
217*
218* Multiply by inv(L).
219*
220 CALL clatps( 'Lower', 'No transpose', 'Non-unit', normin,
221 $ n,
222 $ ap, work, scalel, rwork, info )
223 normin = 'Y'
224*
225* Multiply by inv(L**H).
226*
227 CALL clatps( 'Lower', 'Conjugate transpose', 'Non-unit',
228 $ normin, n, ap, work, scaleu, rwork, info )
229 END IF
230*
231* Multiply by 1/SCALE if doing so will not cause overflow.
232*
233 scale = scalel*scaleu
234 IF( scale.NE.one ) THEN
235 ix = icamax( n, work, 1 )
236 IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
237 $ GO TO 20
238 CALL csrscl( n, scale, work, 1 )
239 END IF
240 GO TO 10
241 END IF
242*
243* Compute the estimate of the reciprocal condition number.
244*
245 IF( ainvnm.NE.zero )
246 $ rcond = ( one / ainvnm ) / anorm
247*
248 20 CONTINUE
249 RETURN
250*
251* End of CPPCON
252*
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 clatps(uplo, trans, diag, normin, n, ap, x, scale, cnorm, info)
CLATPS solves a triangular system of equations with the matrix held in packed storage.
Definition clatps.f:229
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: