LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dgbcon.f
Go to the documentation of this file.
1*> \brief \b DGBCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DGBCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgbcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgbcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgbcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DGBCON( NORM, N, KL, KU, AB, LDAB, IPIV, ANORM, RCOND,
20* WORK, IWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER NORM
24* INTEGER INFO, KL, KU, LDAB, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * ), IWORK( * )
29* DOUBLE PRECISION AB( LDAB, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> DGBCON estimates the reciprocal of the condition number of a real
39*> general band matrix A, in either the 1-norm or the infinity-norm,
40*> using the LU factorization computed by DGBTRF.
41*>
42*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
43*> condition number is 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] N
60*> \verbatim
61*> N is INTEGER
62*> The order of the matrix A. N >= 0.
63*> \endverbatim
64*>
65*> \param[in] KL
66*> \verbatim
67*> KL is INTEGER
68*> The number of subdiagonals within the band of A. KL >= 0.
69*> \endverbatim
70*>
71*> \param[in] KU
72*> \verbatim
73*> KU is INTEGER
74*> The number of superdiagonals within the band of A. KU >= 0.
75*> \endverbatim
76*>
77*> \param[in] AB
78*> \verbatim
79*> AB is DOUBLE PRECISION array, dimension (LDAB,N)
80*> Details of the LU factorization of the band matrix A, as
81*> computed by DGBTRF. U is stored as an upper triangular band
82*> matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and
83*> the multipliers used during the factorization are stored in
84*> rows KL+KU+2 to 2*KL+KU+1.
85*> \endverbatim
86*>
87*> \param[in] LDAB
88*> \verbatim
89*> LDAB is INTEGER
90*> The leading dimension of the array AB. LDAB >= 2*KL+KU+1.
91*> \endverbatim
92*>
93*> \param[in] IPIV
94*> \verbatim
95*> IPIV is INTEGER array, dimension (N)
96*> The pivot indices; for 1 <= i <= N, row i of the matrix was
97*> interchanged with row IPIV(i).
98*> \endverbatim
99*>
100*> \param[in] ANORM
101*> \verbatim
102*> ANORM is DOUBLE PRECISION
103*> If NORM = '1' or 'O', the 1-norm of the original matrix A.
104*> If NORM = 'I', the infinity-norm of the original matrix A.
105*> \endverbatim
106*>
107*> \param[out] RCOND
108*> \verbatim
109*> RCOND is DOUBLE PRECISION
110*> The reciprocal of the condition number of the matrix A,
111*> computed as RCOND = 1/(norm(A) * norm(inv(A))).
112*> \endverbatim
113*>
114*> \param[out] WORK
115*> \verbatim
116*> WORK is DOUBLE PRECISION array, dimension (3*N)
117*> \endverbatim
118*>
119*> \param[out] IWORK
120*> \verbatim
121*> IWORK is INTEGER array, dimension (N)
122*> \endverbatim
123*>
124*> \param[out] INFO
125*> \verbatim
126*> INFO is INTEGER
127*> = 0: successful exit
128*> < 0: if INFO = -i, the i-th argument had an illegal value
129*> \endverbatim
130*
131* Authors:
132* ========
133*
134*> \author Univ. of Tennessee
135*> \author Univ. of California Berkeley
136*> \author Univ. of Colorado Denver
137*> \author NAG Ltd.
138*
139*> \ingroup gbcon
140*
141* =====================================================================
142 SUBROUTINE dgbcon( NORM, N, KL, KU, AB, LDAB, IPIV, ANORM,
143 $ RCOND,
144 $ WORK, IWORK, INFO )
145*
146* -- LAPACK computational routine --
147* -- LAPACK is a software package provided by Univ. of Tennessee, --
148* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
149*
150* .. Scalar Arguments ..
151 CHARACTER NORM
152 INTEGER INFO, KL, KU, LDAB, N
153 DOUBLE PRECISION ANORM, RCOND
154* ..
155* .. Array Arguments ..
156 INTEGER IPIV( * ), IWORK( * )
157 DOUBLE PRECISION AB( LDAB, * ), WORK( * )
158* ..
159*
160* =====================================================================
161*
162* .. Parameters ..
163 DOUBLE PRECISION ONE, ZERO
164 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
165* ..
166* .. Local Scalars ..
167 LOGICAL LNOTI, ONENRM
168 CHARACTER NORMIN
169 INTEGER IX, J, JP, KASE, KASE1, KD, LM
170 DOUBLE PRECISION AINVNM, SCALE, SMLNUM, T
171* ..
172* .. Local Arrays ..
173 INTEGER ISAVE( 3 )
174* ..
175* .. External Functions ..
176 LOGICAL LSAME
177 INTEGER IDAMAX
178 DOUBLE PRECISION DDOT, DLAMCH
179 EXTERNAL lsame, idamax, ddot, dlamch
180* ..
181* .. External Subroutines ..
182 EXTERNAL daxpy, dlacn2, dlatbs, drscl,
183 $ xerbla
184* ..
185* .. Intrinsic Functions ..
186 INTRINSIC abs, min
187* ..
188* .. Executable Statements ..
189*
190* Test the input parameters.
191*
192 info = 0
193 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
194 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
195 info = -1
196 ELSE IF( n.LT.0 ) THEN
197 info = -2
198 ELSE IF( kl.LT.0 ) THEN
199 info = -3
200 ELSE IF( ku.LT.0 ) THEN
201 info = -4
202 ELSE IF( ldab.LT.2*kl+ku+1 ) THEN
203 info = -6
204 ELSE IF( anorm.LT.zero ) THEN
205 info = -8
206 END IF
207 IF( info.NE.0 ) THEN
208 CALL xerbla( 'DGBCON', -info )
209 RETURN
210 END IF
211*
212* Quick return if possible
213*
214 rcond = zero
215 IF( n.EQ.0 ) THEN
216 rcond = one
217 RETURN
218 ELSE IF( anorm.EQ.zero ) THEN
219 RETURN
220 END IF
221*
222 smlnum = dlamch( 'Safe minimum' )
223*
224* Estimate the norm of inv(A).
225*
226 ainvnm = zero
227 normin = 'N'
228 IF( onenrm ) THEN
229 kase1 = 1
230 ELSE
231 kase1 = 2
232 END IF
233 kd = kl + ku + 1
234 lnoti = kl.GT.0
235 kase = 0
236 10 CONTINUE
237 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
238 IF( kase.NE.0 ) THEN
239 IF( kase.EQ.kase1 ) THEN
240*
241* Multiply by inv(L).
242*
243 IF( lnoti ) THEN
244 DO 20 j = 1, n - 1
245 lm = min( kl, n-j )
246 jp = ipiv( j )
247 t = work( jp )
248 IF( jp.NE.j ) THEN
249 work( jp ) = work( j )
250 work( j ) = t
251 END IF
252 CALL daxpy( lm, -t, ab( kd+1, j ), 1, work( j+1 ),
253 $ 1 )
254 20 CONTINUE
255 END IF
256*
257* Multiply by inv(U).
258*
259 CALL dlatbs( 'Upper', 'No transpose', 'Non-unit', normin,
260 $ n,
261 $ kl+ku, ab, ldab, work, scale, work( 2*n+1 ),
262 $ info )
263 ELSE
264*
265* Multiply by inv(U**T).
266*
267 CALL dlatbs( 'Upper', 'Transpose', 'Non-unit', normin, n,
268 $ kl+ku, ab, ldab, work, scale, work( 2*n+1 ),
269 $ info )
270*
271* Multiply by inv(L**T).
272*
273 IF( lnoti ) THEN
274 DO 30 j = n - 1, 1, -1
275 lm = min( kl, n-j )
276 work( j ) = work( j ) - ddot( lm, ab( kd+1, j ), 1,
277 $ work( j+1 ), 1 )
278 jp = ipiv( j )
279 IF( jp.NE.j ) THEN
280 t = work( jp )
281 work( jp ) = work( j )
282 work( j ) = t
283 END IF
284 30 CONTINUE
285 END IF
286 END IF
287*
288* Divide X by 1/SCALE if doing so will not cause overflow.
289*
290 normin = 'Y'
291 IF( scale.NE.one ) THEN
292 ix = idamax( n, work, 1 )
293 IF( scale.LT.abs( work( ix ) )*smlnum .OR. scale.EQ.zero )
294 $ GO TO 40
295 CALL drscl( n, scale, work, 1 )
296 END IF
297 GO TO 10
298 END IF
299*
300* Compute the estimate of the reciprocal condition number.
301*
302 IF( ainvnm.NE.zero )
303 $ rcond = ( one / ainvnm ) / anorm
304*
305 40 CONTINUE
306 RETURN
307*
308* End of DGBCON
309*
310 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
Definition daxpy.f:89
subroutine dgbcon(norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, iwork, info)
DGBCON
Definition dgbcon.f:145
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