LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dpbcon.f
Go to the documentation of this file.
1*> \brief \b DPBCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DPBCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpbcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpbcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DPBCON( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK,
20* IWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, KD, LDAB, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IWORK( * )
29* DOUBLE PRECISION AB( LDAB, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> DPBCON estimates the reciprocal of the condition number (in the
39*> 1-norm) of a real symmetric positive definite band matrix using the
40*> Cholesky factorization A = U**T*U or A = L*L**T computed by DPBTRF.
41*>
42*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
43*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
44*> \endverbatim
45*
46* Arguments:
47* ==========
48*
49*> \param[in] UPLO
50*> \verbatim
51*> UPLO is CHARACTER*1
52*> = 'U': Upper triangular factor stored in AB;
53*> = 'L': Lower triangular factor stored in AB.
54*> \endverbatim
55*>
56*> \param[in] N
57*> \verbatim
58*> N is INTEGER
59*> The order of the matrix A. N >= 0.
60*> \endverbatim
61*>
62*> \param[in] KD
63*> \verbatim
64*> KD is INTEGER
65*> The number of superdiagonals of the matrix A if UPLO = 'U',
66*> or the number of subdiagonals if UPLO = 'L'. KD >= 0.
67*> \endverbatim
68*>
69*> \param[in] AB
70*> \verbatim
71*> AB is DOUBLE PRECISION array, dimension (LDAB,N)
72*> The triangular factor U or L from the Cholesky factorization
73*> A = U**T*U or A = L*L**T of the band matrix A, stored in the
74*> first KD+1 rows of the array. The j-th column of U or L is
75*> stored in the j-th column of the array AB as follows:
76*> if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
77*> if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd).
78*> \endverbatim
79*>
80*> \param[in] LDAB
81*> \verbatim
82*> LDAB is INTEGER
83*> The leading dimension of the array AB. LDAB >= KD+1.
84*> \endverbatim
85*>
86*> \param[in] ANORM
87*> \verbatim
88*> ANORM is DOUBLE PRECISION
89*> The 1-norm (or infinity-norm) of the symmetric band matrix A.
90*> \endverbatim
91*>
92*> \param[out] RCOND
93*> \verbatim
94*> RCOND is DOUBLE PRECISION
95*> The reciprocal of the condition number of the matrix A,
96*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
97*> estimate of the 1-norm of inv(A) computed in this routine.
98*> \endverbatim
99*>
100*> \param[out] WORK
101*> \verbatim
102*> WORK is DOUBLE PRECISION array, dimension (3*N)
103*> \endverbatim
104*>
105*> \param[out] IWORK
106*> \verbatim
107*> IWORK is INTEGER array, dimension (N)
108*> \endverbatim
109*>
110*> \param[out] INFO
111*> \verbatim
112*> INFO is INTEGER
113*> = 0: successful exit
114*> < 0: if INFO = -i, the i-th argument had an illegal value
115*> \endverbatim
116*
117* Authors:
118* ========
119*
120*> \author Univ. of Tennessee
121*> \author Univ. of California Berkeley
122*> \author Univ. of Colorado Denver
123*> \author NAG Ltd.
124*
125*> \ingroup pbcon
126*
127* =====================================================================
128 SUBROUTINE dpbcon( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK,
129 $ IWORK, INFO )
130*
131* -- LAPACK computational routine --
132* -- LAPACK is a software package provided by Univ. of Tennessee, --
133* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134*
135* .. Scalar Arguments ..
136 CHARACTER UPLO
137 INTEGER INFO, KD, LDAB, N
138 DOUBLE PRECISION ANORM, RCOND
139* ..
140* .. Array Arguments ..
141 INTEGER IWORK( * )
142 DOUBLE PRECISION AB( LDAB, * ), WORK( * )
143* ..
144*
145* =====================================================================
146*
147* .. Parameters ..
148 DOUBLE PRECISION ONE, ZERO
149 parameter( one = 1.0d+0, zero = 0.0d+0 )
150* ..
151* .. Local Scalars ..
152 LOGICAL UPPER
153 CHARACTER NORMIN
154 INTEGER IX, KASE
155 DOUBLE PRECISION AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
156* ..
157* .. Local Arrays ..
158 INTEGER ISAVE( 3 )
159* ..
160* .. External Functions ..
161 LOGICAL LSAME
162 INTEGER IDAMAX
163 DOUBLE PRECISION DLAMCH
164 EXTERNAL lsame, idamax, dlamch
165* ..
166* .. External Subroutines ..
167 EXTERNAL dlacn2, dlatbs, drscl, xerbla
168* ..
169* .. Intrinsic Functions ..
170 INTRINSIC abs
171* ..
172* .. Executable Statements ..
173*
174* Test the input parameters.
175*
176 info = 0
177 upper = lsame( uplo, 'U' )
178 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
179 info = -1
180 ELSE IF( n.LT.0 ) THEN
181 info = -2
182 ELSE IF( kd.LT.0 ) THEN
183 info = -3
184 ELSE IF( ldab.LT.kd+1 ) THEN
185 info = -5
186 ELSE IF( anorm.LT.zero ) THEN
187 info = -6
188 END IF
189 IF( info.NE.0 ) THEN
190 CALL xerbla( 'DPBCON', -info )
191 RETURN
192 END IF
193*
194* Quick return if possible
195*
196 rcond = zero
197 IF( n.EQ.0 ) THEN
198 rcond = one
199 RETURN
200 ELSE IF( anorm.EQ.zero ) THEN
201 RETURN
202 END IF
203*
204 smlnum = dlamch( 'Safe minimum' )
205*
206* Estimate the 1-norm of the inverse.
207*
208 kase = 0
209 normin = 'N'
210 10 CONTINUE
211 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
212 IF( kase.NE.0 ) THEN
213 IF( upper ) THEN
214*
215* Multiply by inv(U**T).
216*
217 CALL dlatbs( 'Upper', 'Transpose', 'Non-unit', normin, n,
218 $ kd, ab, ldab, work, scalel, work( 2*n+1 ),
219 $ info )
220 normin = 'Y'
221*
222* Multiply by inv(U).
223*
224 CALL dlatbs( 'Upper', 'No transpose', 'Non-unit', normin,
225 $ n,
226 $ kd, ab, ldab, work, scaleu, work( 2*n+1 ),
227 $ info )
228 ELSE
229*
230* Multiply by inv(L).
231*
232 CALL dlatbs( 'Lower', 'No transpose', 'Non-unit', normin,
233 $ n,
234 $ kd, ab, ldab, work, scalel, work( 2*n+1 ),
235 $ info )
236 normin = 'Y'
237*
238* Multiply by inv(L**T).
239*
240 CALL dlatbs( 'Lower', 'Transpose', 'Non-unit', normin, n,
241 $ kd, ab, ldab, work, scaleu, work( 2*n+1 ),
242 $ info )
243 END IF
244*
245* Multiply by 1/SCALE if doing so will not cause overflow.
246*
247 scale = scalel*scaleu
248 IF( scale.NE.one ) THEN
249 ix = idamax( n, work, 1 )
250 IF( scale.LT.abs( work( ix ) )*smlnum .OR. scale.EQ.zero )
251 $ GO TO 20
252 CALL drscl( n, scale, work, 1 )
253 END IF
254 GO TO 10
255 END IF
256*
257* Compute the estimate of the reciprocal condition number.
258*
259 IF( ainvnm.NE.zero )
260 $ rcond = ( one / ainvnm ) / anorm
261*
262 20 CONTINUE
263*
264 RETURN
265*
266* End of DPBCON
267*
268 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition dlacn2.f:134
subroutine dlatbs(uplo, trans, diag, normin, n, kd, ab, ldab, x, scale, cnorm, info)
DLATBS solves a triangular banded system of equations.
Definition dlatbs.f:241
subroutine dpbcon(uplo, n, kd, ab, ldab, anorm, rcond, work, iwork, info)
DPBCON
Definition dpbcon.f:130
subroutine drscl(n, sa, sx, incx)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition drscl.f:82