LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cgtcon.f
Go to the documentation of this file.
1*> \brief \b CGTCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CGTCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgtcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cgtcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgtcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
20* WORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER NORM
24* INTEGER INFO, N
25* REAL ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> CGTCON estimates the reciprocal of the condition number of a complex
39*> tridiagonal matrix A using the LU factorization as computed by
40*> CGTTRF.
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 COMPLEX array, dimension (N-1)
67*> The (n-1) multipliers that define the matrix L from the
68*> LU factorization of A as computed by CGTTRF.
69*> \endverbatim
70*>
71*> \param[in] D
72*> \verbatim
73*> D is COMPLEX 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 COMPLEX 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 COMPLEX 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 REAL
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 REAL
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 COMPLEX array, dimension (2*N)
117*> \endverbatim
118*>
119*> \param[out] INFO
120*> \verbatim
121*> INFO is INTEGER
122*> = 0: successful exit
123*> < 0: if INFO = -i, the i-th argument had an illegal value
124*> \endverbatim
125*
126* Authors:
127* ========
128*
129*> \author Univ. of Tennessee
130*> \author Univ. of California Berkeley
131*> \author Univ. of Colorado Denver
132*> \author NAG Ltd.
133*
134*> \ingroup gtcon
135*
136* =====================================================================
137 SUBROUTINE cgtcon( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
138 $ WORK, INFO )
139*
140* -- LAPACK computational routine --
141* -- LAPACK is a software package provided by Univ. of Tennessee, --
142* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
143*
144* .. Scalar Arguments ..
145 CHARACTER NORM
146 INTEGER INFO, N
147 REAL ANORM, RCOND
148* ..
149* .. Array Arguments ..
150 INTEGER IPIV( * )
151 COMPLEX D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
152* ..
153*
154* =====================================================================
155*
156* .. Parameters ..
157 REAL ONE, ZERO
158 parameter( one = 1.0e+0, zero = 0.0e+0 )
159* ..
160* .. Local Scalars ..
161 LOGICAL ONENRM
162 INTEGER I, KASE, KASE1
163 REAL AINVNM
164* ..
165* .. Local Arrays ..
166 INTEGER ISAVE( 3 )
167* ..
168* .. External Functions ..
169 LOGICAL LSAME
170 EXTERNAL lsame
171* ..
172* .. External Subroutines ..
173 EXTERNAL cgttrs, clacn2, xerbla
174* ..
175* .. Intrinsic Functions ..
176 INTRINSIC cmplx
177* ..
178* .. Executable Statements ..
179*
180* Test the input arguments.
181*
182 info = 0
183 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
184 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
185 info = -1
186 ELSE IF( n.LT.0 ) THEN
187 info = -2
188 ELSE IF( anorm.LT.zero ) THEN
189 info = -8
190 END IF
191 IF( info.NE.0 ) THEN
192 CALL xerbla( 'CGTCON', -info )
193 RETURN
194 END IF
195*
196* Quick return if possible
197*
198 rcond = zero
199 IF( n.EQ.0 ) THEN
200 rcond = one
201 RETURN
202 ELSE IF( anorm.EQ.zero ) THEN
203 RETURN
204 END IF
205*
206* Check that D(1:N) is non-zero.
207*
208 DO 10 i = 1, n
209 IF( d( i ).EQ.cmplx( zero ) )
210 $ RETURN
211 10 CONTINUE
212*
213 ainvnm = zero
214 IF( onenrm ) THEN
215 kase1 = 1
216 ELSE
217 kase1 = 2
218 END IF
219 kase = 0
220 20 CONTINUE
221 CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
222 IF( kase.NE.0 ) THEN
223 IF( kase.EQ.kase1 ) THEN
224*
225* Multiply by inv(U)*inv(L).
226*
227 CALL cgttrs( 'No transpose', n, 1, dl, d, du, du2, ipiv,
228 $ work, n, info )
229 ELSE
230*
231* Multiply by inv(L**H)*inv(U**H).
232*
233 CALL cgttrs( 'Conjugate transpose', n, 1, dl, d, du, du2,
234 $ ipiv, work, n, info )
235 END IF
236 GO TO 20
237 END IF
238*
239* Compute the estimate of the reciprocal condition number.
240*
241 IF( ainvnm.NE.zero )
242 $ rcond = ( one / ainvnm ) / anorm
243*
244 RETURN
245*
246* End of CGTCON
247*
248 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine cgtcon(norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, info)
CGTCON
Definition cgtcon.f:139
subroutine cgttrs(trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info)
CGTTRS
Definition cgttrs.f:137
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