LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cpbcon.f
Go to the documentation of this file.
1*> \brief \b CPBCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CPBCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpbcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpbcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CPBCON( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK,
20* RWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, KD, LDAB, N
25* REAL ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* REAL RWORK( * )
29* COMPLEX AB( LDAB, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> CPBCON estimates the reciprocal of the condition number (in the
39*> 1-norm) of a complex Hermitian positive definite band matrix using
40*> the Cholesky factorization A = U**H*U or A = L*L**H computed by
41*> CPBTRF.
42*>
43*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
44*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
45*> \endverbatim
46*
47* Arguments:
48* ==========
49*
50*> \param[in] UPLO
51*> \verbatim
52*> UPLO is CHARACTER*1
53*> = 'U': Upper triangular factor stored in AB;
54*> = 'L': Lower triangular factor stored in AB.
55*> \endverbatim
56*>
57*> \param[in] N
58*> \verbatim
59*> N is INTEGER
60*> The order of the matrix A. N >= 0.
61*> \endverbatim
62*>
63*> \param[in] KD
64*> \verbatim
65*> KD is INTEGER
66*> The number of superdiagonals of the matrix A if UPLO = 'U',
67*> or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
68*> \endverbatim
69*>
70*> \param[in] AB
71*> \verbatim
72*> AB is COMPLEX array, dimension (LDAB,N)
73*> The triangular factor U or L from the Cholesky factorization
74*> A = U**H*U or A = L*L**H of the band matrix A, stored in the
75*> first KD+1 rows of the array. The j-th column of U or L is
76*> stored in the j-th column of the array AB as follows:
77*> if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
78*> if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd).
79*> \endverbatim
80*>
81*> \param[in] LDAB
82*> \verbatim
83*> LDAB is INTEGER
84*> The leading dimension of the array AB. LDAB >= KD+1.
85*> \endverbatim
86*>
87*> \param[in] ANORM
88*> \verbatim
89*> ANORM is REAL
90*> The 1-norm (or infinity-norm) of the Hermitian band matrix A.
91*> \endverbatim
92*>
93*> \param[out] RCOND
94*> \verbatim
95*> RCOND is REAL
96*> The reciprocal of the condition number of the matrix A,
97*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
98*> estimate of the 1-norm of inv(A) computed in this routine.
99*> \endverbatim
100*>
101*> \param[out] WORK
102*> \verbatim
103*> WORK is COMPLEX array, dimension (2*N)
104*> \endverbatim
105*>
106*> \param[out] RWORK
107*> \verbatim
108*> RWORK is REAL array, dimension (N)
109*> \endverbatim
110*>
111*> \param[out] INFO
112*> \verbatim
113*> INFO is INTEGER
114*> = 0: successful exit
115*> < 0: if INFO = -i, the i-th argument had an illegal value
116*> \endverbatim
117*
118* Authors:
119* ========
120*
121*> \author Univ. of Tennessee
122*> \author Univ. of California Berkeley
123*> \author Univ. of Colorado Denver
124*> \author NAG Ltd.
125*
126*> \ingroup pbcon
127*
128* =====================================================================
129 SUBROUTINE cpbcon( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK,
130 $ RWORK, INFO )
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*
274 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
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
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
subroutine cpbcon(uplo, n, kd, ab, ldab, anorm, rcond, work, rwork, info)
CPBCON
Definition cpbcon.f:131
subroutine csrscl(n, sa, sx, incx)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
Definition csrscl.f:82