LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
checon.f
Go to the documentation of this file.
1*> \brief \b CHECON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CHECON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/checon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/checon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/checon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CHECON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
20* INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, N
25* REAL ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX A( LDA, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> CHECON estimates the reciprocal of the condition number of a complex
39*> Hermitian matrix A using the factorization A = U*D*U**H or
40*> A = L*D*L**H computed by CHETRF.
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*> Specifies whether the details of the factorization are stored
53*> as an upper or lower triangular matrix.
54*> = 'U': Upper triangular, form is A = U*D*U**H;
55*> = 'L': Lower triangular, form is A = L*D*L**H.
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] A
65*> \verbatim
66*> A is COMPLEX array, dimension (LDA,N)
67*> The block diagonal matrix D and the multipliers used to
68*> obtain the factor U or L as computed by CHETRF.
69*> \endverbatim
70*>
71*> \param[in] LDA
72*> \verbatim
73*> LDA is INTEGER
74*> The leading dimension of the array A. LDA >= max(1,N).
75*> \endverbatim
76*>
77*> \param[in] IPIV
78*> \verbatim
79*> IPIV is INTEGER array, dimension (N)
80*> Details of the interchanges and the block structure of D
81*> as determined by CHETRF.
82*> \endverbatim
83*>
84*> \param[in] ANORM
85*> \verbatim
86*> ANORM is REAL
87*> The 1-norm of the original matrix A.
88*> \endverbatim
89*>
90*> \param[out] RCOND
91*> \verbatim
92*> RCOND is REAL
93*> The reciprocal of the condition number of the matrix A,
94*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
95*> estimate of the 1-norm of inv(A) computed in this routine.
96*> \endverbatim
97*>
98*> \param[out] WORK
99*> \verbatim
100*> WORK is COMPLEX array, dimension (2*N)
101*> \endverbatim
102*>
103*> \param[out] INFO
104*> \verbatim
105*> INFO is INTEGER
106*> = 0: successful exit
107*> < 0: if INFO = -i, the i-th argument had an illegal value
108*> \endverbatim
109*
110* Authors:
111* ========
112*
113*> \author Univ. of Tennessee
114*> \author Univ. of California Berkeley
115*> \author Univ. of Colorado Denver
116*> \author NAG Ltd.
117*
118*> \ingroup hecon
119*
120* =====================================================================
121 SUBROUTINE checon( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
122 $ INFO )
123*
124* -- LAPACK computational routine --
125* -- LAPACK is a software package provided by Univ. of Tennessee, --
126* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
127*
128* .. Scalar Arguments ..
129 CHARACTER UPLO
130 INTEGER INFO, LDA, N
131 REAL ANORM, RCOND
132* ..
133* .. Array Arguments ..
134 INTEGER IPIV( * )
135 COMPLEX A( LDA, * ), WORK( * )
136* ..
137*
138* =====================================================================
139*
140* .. Parameters ..
141 REAL ONE, ZERO
142 parameter( one = 1.0e+0, zero = 0.0e+0 )
143* ..
144* .. Local Scalars ..
145 LOGICAL UPPER
146 INTEGER I, KASE
147 REAL AINVNM
148* ..
149* .. Local Arrays ..
150 INTEGER ISAVE( 3 )
151* ..
152* .. External Functions ..
153 LOGICAL LSAME
154 EXTERNAL lsame
155* ..
156* .. External Subroutines ..
157 EXTERNAL chetrs, clacn2, xerbla
158* ..
159* .. Intrinsic Functions ..
160 INTRINSIC max
161* ..
162* .. Executable Statements ..
163*
164* Test the input parameters.
165*
166 info = 0
167 upper = lsame( uplo, 'U' )
168 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
169 info = -1
170 ELSE IF( n.LT.0 ) THEN
171 info = -2
172 ELSE IF( lda.LT.max( 1, n ) ) THEN
173 info = -4
174 ELSE IF( anorm.LT.zero ) THEN
175 info = -6
176 END IF
177 IF( info.NE.0 ) THEN
178 CALL xerbla( 'CHECON', -info )
179 RETURN
180 END IF
181*
182* Quick return if possible
183*
184 rcond = zero
185 IF( n.EQ.0 ) THEN
186 rcond = one
187 RETURN
188 ELSE IF( anorm.LE.zero ) THEN
189 RETURN
190 END IF
191*
192* Check that the diagonal matrix D is nonsingular.
193*
194 IF( upper ) THEN
195*
196* Upper triangular storage: examine D from bottom to top
197*
198 DO 10 i = n, 1, -1
199 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
200 $ RETURN
201 10 CONTINUE
202 ELSE
203*
204* Lower triangular storage: examine D from top to bottom.
205*
206 DO 20 i = 1, n
207 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
208 $ RETURN
209 20 CONTINUE
210 END IF
211*
212* Estimate the 1-norm of the inverse.
213*
214 kase = 0
215 30 CONTINUE
216 CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
217 IF( kase.NE.0 ) THEN
218*
219* Multiply by inv(L*D*L**H) or inv(U*D*U**H).
220*
221 CALL chetrs( uplo, n, 1, a, lda, ipiv, work, n, info )
222 GO TO 30
223 END IF
224*
225* Compute the estimate of the reciprocal condition number.
226*
227 IF( ainvnm.NE.zero )
228 $ rcond = ( one / ainvnm ) / anorm
229*
230 RETURN
231*
232* End of CHECON
233*
234 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine checon(uplo, n, a, lda, ipiv, anorm, rcond, work, info)
CHECON
Definition checon.f:123
subroutine chetrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CHETRS
Definition chetrs.f:118
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