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

◆ cpbcon()

subroutine cpbcon ( character uplo,
integer n,
integer kd,
complex, dimension( ldab, * ) ab,
integer ldab,
real anorm,
real rcond,
complex, dimension( * ) work,
real, dimension( * ) rwork,
integer info )

CPBCON

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

Purpose:
!>
!> CPBCON estimates the reciprocal of the condition number (in the
!> 1-norm) of a complex Hermitian positive definite band matrix using
!> the Cholesky factorization A = U**H*U or A = L*L**H computed by
!> CPBTRF.
!>
!> 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 triangular factor stored in AB;
!>          = 'L':  Lower triangular factor stored in AB.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]KD
!>          KD is INTEGER
!>          The number of superdiagonals of the matrix A if UPLO = 'U',
!>          or the number of sub-diagonals if UPLO = 'L'.  KD >= 0.
!> 
[in]AB
!>          AB is COMPLEX array, dimension (LDAB,N)
!>          The triangular factor U or L from the Cholesky factorization
!>          A = U**H*U or A = L*L**H of the band matrix A, stored in the
!>          first KD+1 rows of the array.  The j-th column of U or L is
!>          stored in the j-th column of the array AB as follows:
!>          if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
!>          if UPLO ='L', AB(1+i-j,j)    = L(i,j) for j<=i<=min(n,j+kd).
!> 
[in]LDAB
!>          LDAB is INTEGER
!>          The leading dimension of the array AB.  LDAB >= KD+1.
!> 
[in]ANORM
!>          ANORM is REAL
!>          The 1-norm (or infinity-norm) of the Hermitian band 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 129 of file cpbcon.f.

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