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