LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ checon()

subroutine checon ( character  uplo,
integer  n,
complex, dimension( lda, * )  a,
integer  lda,
integer, dimension( * )  ipiv,
real  anorm,
real  rcond,
complex, dimension( * )  work,
integer  info 
)

CHECON

Download CHECON + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 CHECON estimates the reciprocal of the condition number of a complex
 Hermitian matrix A using the factorization A = U*D*U**H or
 A = L*D*L**H computed by CHETRF.

 An estimate is obtained for norm(inv(A)), and the reciprocal of the
 condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the details of the factorization are stored
          as an upper or lower triangular matrix.
          = 'U':  Upper triangular, form is A = U*D*U**H;
          = 'L':  Lower triangular, form is A = L*D*L**H.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The block diagonal matrix D and the multipliers used to
          obtain the factor U or L as computed by CHETRF.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          Details of the interchanges and the block structure of D
          as determined by CHETRF.
[in]ANORM
          ANORM is REAL
          The 1-norm of the original matrix A.
[out]RCOND
          RCOND is REAL
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
          estimate of the 1-norm of inv(A) computed in this routine.
[out]WORK
          WORK is COMPLEX array, dimension (2*N)
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 123 of file checon.f.

125*
126* -- LAPACK computational routine --
127* -- LAPACK is a software package provided by Univ. of Tennessee, --
128* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129*
130* .. Scalar Arguments ..
131 CHARACTER UPLO
132 INTEGER INFO, LDA, N
133 REAL ANORM, RCOND
134* ..
135* .. Array Arguments ..
136 INTEGER IPIV( * )
137 COMPLEX A( LDA, * ), WORK( * )
138* ..
139*
140* =====================================================================
141*
142* .. Parameters ..
143 REAL ONE, ZERO
144 parameter( one = 1.0e+0, zero = 0.0e+0 )
145* ..
146* .. Local Scalars ..
147 LOGICAL UPPER
148 INTEGER I, KASE
149 REAL AINVNM
150* ..
151* .. Local Arrays ..
152 INTEGER ISAVE( 3 )
153* ..
154* .. External Functions ..
155 LOGICAL LSAME
156 EXTERNAL lsame
157* ..
158* .. External Subroutines ..
159 EXTERNAL chetrs, clacn2, xerbla
160* ..
161* .. Intrinsic Functions ..
162 INTRINSIC max
163* ..
164* .. Executable Statements ..
165*
166* Test the input parameters.
167*
168 info = 0
169 upper = lsame( uplo, 'U' )
170 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
171 info = -1
172 ELSE IF( n.LT.0 ) THEN
173 info = -2
174 ELSE IF( lda.LT.max( 1, n ) ) THEN
175 info = -4
176 ELSE IF( anorm.LT.zero ) THEN
177 info = -6
178 END IF
179 IF( info.NE.0 ) THEN
180 CALL xerbla( 'CHECON', -info )
181 RETURN
182 END IF
183*
184* Quick return if possible
185*
186 rcond = zero
187 IF( n.EQ.0 ) THEN
188 rcond = one
189 RETURN
190 ELSE IF( anorm.LE.zero ) THEN
191 RETURN
192 END IF
193*
194* Check that the diagonal matrix D is nonsingular.
195*
196 IF( upper ) THEN
197*
198* Upper triangular storage: examine D from bottom to top
199*
200 DO 10 i = n, 1, -1
201 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
202 $ RETURN
203 10 CONTINUE
204 ELSE
205*
206* Lower triangular storage: examine D from top to bottom.
207*
208 DO 20 i = 1, n
209 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
210 $ RETURN
211 20 CONTINUE
212 END IF
213*
214* Estimate the 1-norm of the inverse.
215*
216 kase = 0
217 30 CONTINUE
218 CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
219 IF( kase.NE.0 ) THEN
220*
221* Multiply by inv(L*D*L**H) or inv(U*D*U**H).
222*
223 CALL chetrs( uplo, n, 1, a, lda, ipiv, work, n, info )
224 GO TO 30
225 END IF
226*
227* Compute the estimate of the reciprocal condition number.
228*
229 IF( ainvnm.NE.zero )
230 $ rcond = ( one / ainvnm ) / anorm
231*
232 RETURN
233*
234* End of CHECON
235*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine chetrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CHETRS
Definition chetrs.f:120
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:133
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: