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

◆ zgecon()

subroutine zgecon ( character norm,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
double precision anorm,
double precision rcond,
complex*16, dimension( * ) work,
double precision, dimension( * ) rwork,
integer info )

ZGECON

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

Purpose:
!>
!> ZGECON estimates the reciprocal of the condition number of a general
!> complex matrix A, in either the 1-norm or the infinity-norm, using
!> the LU factorization computed by ZGETRF.
!>
!> An estimate is obtained for norm(inv(A)), and the reciprocal of the
!> condition number is computed as
!>    RCOND = 1 / ( norm(A) * norm(inv(A)) ).
!> 
Parameters
[in]NORM
!>          NORM is CHARACTER*1
!>          Specifies whether the 1-norm condition number or the
!>          infinity-norm condition number is required:
!>          = '1' or 'O':  1-norm;
!>          = 'I':         Infinity-norm.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          The factors L and U from the factorization A = P*L*U
!>          as computed by ZGETRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]ANORM
!>          ANORM is DOUBLE PRECISION
!>          If NORM = '1' or 'O', the 1-norm of the original matrix A.
!>          If NORM = 'I', the infinity-norm of the original matrix A.
!> 
[out]RCOND
!>          RCOND is DOUBLE PRECISION
!>          The reciprocal of the condition number of the matrix A,
!>          computed as RCOND = 1/(norm(A) * norm(inv(A))).
!> 
[out]WORK
!>          WORK is COMPLEX*16 array, dimension (2*N)
!> 
[out]RWORK
!>          RWORK is DOUBLE PRECISION array, dimension (2*N)
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value.
!>                NaNs are illegal values for ANORM, and they propagate to
!>                the output parameter RCOND.
!>                Infinity is illegal for ANORM, and it propagates to the output
!>                parameter RCOND as 0.
!>          = 1:  if RCOND = NaN, or
!>                   RCOND = Inf, or
!>                   the computed norm of the inverse of A is 0.
!>                In the latter, RCOND = 0 is returned.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 128 of file zgecon.f.

130*
131* -- LAPACK computational routine --
132* -- LAPACK is a software package provided by Univ. of Tennessee, --
133* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134*
135* .. Scalar Arguments ..
136 CHARACTER NORM
137 INTEGER INFO, LDA, N
138 DOUBLE PRECISION ANORM, RCOND
139* ..
140* .. Array Arguments ..
141 DOUBLE PRECISION RWORK( * )
142 COMPLEX*16 A( LDA, * ), WORK( * )
143* ..
144*
145* =====================================================================
146*
147* .. Parameters ..
148 DOUBLE PRECISION ONE, ZERO
149 parameter( one = 1.0d+0, zero = 0.0d+0 )
150* ..
151* .. Local Scalars ..
152 LOGICAL ONENRM
153 CHARACTER NORMIN
154 INTEGER IX, KASE, KASE1
155 DOUBLE PRECISION AINVNM, SCALE, SL, SMLNUM, SU, HUGEVAL
156 COMPLEX*16 ZDUM
157* ..
158* .. Local Arrays ..
159 INTEGER ISAVE( 3 )
160* ..
161* .. External Functions ..
162 LOGICAL LSAME, DISNAN
163 INTEGER IZAMAX
164 DOUBLE PRECISION DLAMCH
165 EXTERNAL lsame, izamax, dlamch, disnan
166* ..
167* .. External Subroutines ..
168 EXTERNAL xerbla, zdrscl, zlacn2, zlatrs
169* ..
170* .. Intrinsic Functions ..
171 INTRINSIC abs, dble, dimag, max
172* ..
173* .. Statement Functions ..
174 DOUBLE PRECISION CABS1
175* ..
176* .. Statement Function definitions ..
177 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
178* ..
179* .. Executable Statements ..
180*
181 hugeval = dlamch( 'Overflow' )
182*
183* Test the input parameters.
184*
185 info = 0
186 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
187 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
188 info = -1
189 ELSE IF( n.LT.0 ) THEN
190 info = -2
191 ELSE IF( lda.LT.max( 1, n ) ) THEN
192 info = -4
193 ELSE IF( anorm.LT.zero ) THEN
194 info = -5
195 END IF
196 IF( info.NE.0 ) THEN
197 CALL xerbla( 'ZGECON', -info )
198 RETURN
199 END IF
200*
201* Quick return if possible
202*
203 rcond = zero
204 IF( n.EQ.0 ) THEN
205 rcond = one
206 RETURN
207 ELSE IF( anorm.EQ.zero ) THEN
208 RETURN
209 ELSE IF( disnan( anorm ) ) THEN
210 rcond = anorm
211 info = -5
212 RETURN
213 ELSE IF( anorm.GT.hugeval ) THEN
214 info = -5
215 RETURN
216 END IF
217*
218 smlnum = dlamch( 'Safe minimum' )
219*
220* Estimate the norm of inv(A).
221*
222 ainvnm = zero
223 normin = 'N'
224 IF( onenrm ) THEN
225 kase1 = 1
226 ELSE
227 kase1 = 2
228 END IF
229 kase = 0
230 10 CONTINUE
231 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
232 IF( kase.NE.0 ) THEN
233 IF( kase.EQ.kase1 ) THEN
234*
235* Multiply by inv(L).
236*
237 CALL zlatrs( 'Lower', 'No transpose', 'Unit', normin, n,
238 $ a,
239 $ lda, work, sl, rwork, info )
240*
241* Multiply by inv(U).
242*
243 CALL zlatrs( 'Upper', 'No transpose', 'Non-unit', normin,
244 $ n,
245 $ a, lda, work, su, rwork( n+1 ), info )
246 ELSE
247*
248* Multiply by inv(U**H).
249*
250 CALL zlatrs( 'Upper', 'Conjugate transpose', 'Non-unit',
251 $ normin, n, a, lda, work, su, rwork( n+1 ),
252 $ info )
253*
254* Multiply by inv(L**H).
255*
256 CALL zlatrs( 'Lower', 'Conjugate transpose', 'Unit',
257 $ normin,
258 $ n, a, lda, work, sl, rwork, info )
259 END IF
260*
261* Divide X by 1/(SL*SU) if doing so will not cause overflow.
262*
263 scale = sl*su
264 normin = 'Y'
265 IF( scale.NE.one ) THEN
266 ix = izamax( n, work, 1 )
267 IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
268 $ GO TO 20
269 CALL zdrscl( n, scale, work, 1 )
270 END IF
271 GO TO 10
272 END IF
273*
274* Compute the estimate of the reciprocal condition number.
275*
276 IF( ainvnm.NE.zero ) THEN
277 rcond = ( one / ainvnm ) / anorm
278 ELSE
279 info = 1
280 RETURN
281 END IF
282*
283* Check for NaNs and Infs
284*
285 IF( disnan( rcond ) .OR. rcond.GT.hugeval )
286 $ info = 1
287*
288 20 CONTINUE
289 RETURN
290*
291* End of ZGECON
292*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function izamax(n, zx, incx)
IZAMAX
Definition izamax.f:71
logical function disnan(din)
DISNAN tests input for NaN.
Definition disnan.f:57
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition zlacn2.f:131
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
subroutine zlatrs(uplo, trans, diag, normin, n, a, lda, x, scale, cnorm, info)
ZLATRS solves a triangular system of equations with the scale factor set to prevent overflow.
Definition zlatrs.f:238
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zdrscl(n, sa, sx, incx)
ZDRSCL multiplies a vector by the reciprocal of a real scalar.
Definition zdrscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: