LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dgtcon.f
Go to the documentation of this file.
1*> \brief \b DGTCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DGTCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgtcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgtcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgtcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
20* WORK, IWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER NORM
24* INTEGER INFO, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * ), IWORK( * )
29* DOUBLE PRECISION D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> DGTCON estimates the reciprocal of the condition number of a real
39*> tridiagonal matrix A using the LU factorization as computed by
40*> DGTTRF.
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] NORM
50*> \verbatim
51*> NORM is CHARACTER*1
52*> Specifies whether the 1-norm condition number or the
53*> infinity-norm condition number is required:
54*> = '1' or 'O': 1-norm;
55*> = 'I': Infinity-norm.
56*> \endverbatim
57*>
58*> \param[in] N
59*> \verbatim
60*> N is INTEGER
61*> The order of the matrix A. N >= 0.
62*> \endverbatim
63*>
64*> \param[in] DL
65*> \verbatim
66*> DL is DOUBLE PRECISION array, dimension (N-1)
67*> The (n-1) multipliers that define the matrix L from the
68*> LU factorization of A as computed by DGTTRF.
69*> \endverbatim
70*>
71*> \param[in] D
72*> \verbatim
73*> D is DOUBLE PRECISION array, dimension (N)
74*> The n diagonal elements of the upper triangular matrix U from
75*> the LU factorization of A.
76*> \endverbatim
77*>
78*> \param[in] DU
79*> \verbatim
80*> DU is DOUBLE PRECISION array, dimension (N-1)
81*> The (n-1) elements of the first superdiagonal of U.
82*> \endverbatim
83*>
84*> \param[in] DU2
85*> \verbatim
86*> DU2 is DOUBLE PRECISION array, dimension (N-2)
87*> The (n-2) elements of the second superdiagonal of U.
88*> \endverbatim
89*>
90*> \param[in] IPIV
91*> \verbatim
92*> IPIV is INTEGER array, dimension (N)
93*> The pivot indices; for 1 <= i <= n, row i of the matrix was
94*> interchanged with row IPIV(i). IPIV(i) will always be either
95*> i or i+1; IPIV(i) = i indicates a row interchange was not
96*> required.
97*> \endverbatim
98*>
99*> \param[in] ANORM
100*> \verbatim
101*> ANORM is DOUBLE PRECISION
102*> If NORM = '1' or 'O', the 1-norm of the original matrix A.
103*> If NORM = 'I', the infinity-norm of the original matrix A.
104*> \endverbatim
105*>
106*> \param[out] RCOND
107*> \verbatim
108*> RCOND is DOUBLE PRECISION
109*> The reciprocal of the condition number of the matrix A,
110*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
111*> estimate of the 1-norm of inv(A) computed in this routine.
112*> \endverbatim
113*>
114*> \param[out] WORK
115*> \verbatim
116*> WORK is DOUBLE PRECISION array, dimension (2*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 gtcon
140*
141* =====================================================================
142 SUBROUTINE dgtcon( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
143 $ WORK, IWORK, INFO )
144*
145* -- LAPACK computational routine --
146* -- LAPACK is a software package provided by Univ. of Tennessee, --
147* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
148*
149* .. Scalar Arguments ..
150 CHARACTER NORM
151 INTEGER INFO, N
152 DOUBLE PRECISION ANORM, RCOND
153* ..
154* .. Array Arguments ..
155 INTEGER IPIV( * ), IWORK( * )
156 DOUBLE PRECISION D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
157* ..
158*
159* =====================================================================
160*
161* .. Parameters ..
162 DOUBLE PRECISION ONE, ZERO
163 parameter( one = 1.0d+0, zero = 0.0d+0 )
164* ..
165* .. Local Scalars ..
166 LOGICAL ONENRM
167 INTEGER I, KASE, KASE1
168 DOUBLE PRECISION AINVNM
169* ..
170* .. Local Arrays ..
171 INTEGER ISAVE( 3 )
172* ..
173* .. External Functions ..
174 LOGICAL LSAME
175 EXTERNAL lsame
176* ..
177* .. External Subroutines ..
178 EXTERNAL dgttrs, dlacn2, xerbla
179* ..
180* .. Executable Statements ..
181*
182* Test the input arguments.
183*
184 info = 0
185 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
186 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
187 info = -1
188 ELSE IF( n.LT.0 ) THEN
189 info = -2
190 ELSE IF( anorm.LT.zero ) THEN
191 info = -8
192 END IF
193 IF( info.NE.0 ) THEN
194 CALL xerbla( 'DGTCON', -info )
195 RETURN
196 END IF
197*
198* Quick return if possible
199*
200 rcond = zero
201 IF( n.EQ.0 ) THEN
202 rcond = one
203 RETURN
204 ELSE IF( anorm.EQ.zero ) THEN
205 RETURN
206 END IF
207*
208* Check that D(1:N) is non-zero.
209*
210 DO 10 i = 1, n
211 IF( d( i ).EQ.zero )
212 $ RETURN
213 10 CONTINUE
214*
215 ainvnm = zero
216 IF( onenrm ) THEN
217 kase1 = 1
218 ELSE
219 kase1 = 2
220 END IF
221 kase = 0
222 20 CONTINUE
223 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
224 IF( kase.NE.0 ) THEN
225 IF( kase.EQ.kase1 ) THEN
226*
227* Multiply by inv(U)*inv(L).
228*
229 CALL dgttrs( 'No transpose', n, 1, dl, d, du, du2, ipiv,
230 $ work, n, info )
231 ELSE
232*
233* Multiply by inv(L**T)*inv(U**T).
234*
235 CALL dgttrs( 'Transpose', n, 1, dl, d, du, du2, ipiv,
236 $ work,
237 $ n, info )
238 END IF
239 GO TO 20
240 END IF
241*
242* Compute the estimate of the reciprocal condition number.
243*
244 IF( ainvnm.NE.zero )
245 $ rcond = ( one / ainvnm ) / anorm
246*
247 RETURN
248*
249* End of DGTCON
250*
251 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dgtcon(norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info)
DGTCON
Definition dgtcon.f:144
subroutine dgttrs(trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info)
DGTTRS
Definition dgttrs.f:137
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