3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZGECON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgecon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgecon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgecon.f">
21 * SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
24 * .. Scalar Arguments ..
26 * INTEGER INFO, LDA, N
27 * DOUBLE PRECISION ANORM, RCOND
29 * .. Array Arguments ..
30 * DOUBLE PRECISION RWORK( * )
31 * COMPLEX*16 A( LDA, * ), WORK( * )
40 *> ZGECON estimates the reciprocal of the condition number of a general
41 *> complex matrix A, in either the 1-norm or the infinity-norm, using
42 *> the LU factorization computed by ZGETRF.
44 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
45 *> condition number is computed as
46 *> RCOND = 1 / ( norm(A) * norm(inv(A)) ).
54 *> NORM is CHARACTER*1
55 *> Specifies whether the 1-norm condition number or the
56 *> infinity-norm condition number is required:
57 *> = '1' or 'O': 1-norm;
58 *> = 'I': Infinity-norm.
64 *> The order of the matrix A. N >= 0.
69 *> A is COMPLEX*16 array, dimension (LDA,N)
70 *> The factors L and U from the factorization A = P*L*U
71 *> as computed by ZGETRF.
77 *> The leading dimension of the array A. LDA >= max(1,N).
82 *> ANORM is DOUBLE PRECISION
83 *> If NORM = '1' or 'O', the 1-norm of the original matrix A.
84 *> If NORM = 'I', the infinity-norm of the original matrix A.
89 *> RCOND is DOUBLE PRECISION
90 *> The reciprocal of the condition number of the matrix A,
91 *> computed as RCOND = 1/(norm(A) * norm(inv(A))).
96 *> WORK is COMPLEX*16 array, dimension (2*N)
101 *> RWORK is DOUBLE PRECISION array, dimension (2*N)
107 *> = 0: successful exit
108 *> < 0: if INFO = -i, the i-th argument had an illegal value
114 *> \author Univ. of Tennessee
115 *> \author Univ. of California Berkeley
116 *> \author Univ. of Colorado Denver
119 *> \date November 2011
121 *> \ingroup complex16GEcomputational
123 * =====================================================================
124 SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
127 * -- LAPACK computational routine (version 3.4.0) --
128 * -- LAPACK is a software package provided by Univ. of Tennessee, --
129 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132 * .. Scalar Arguments ..
135 DOUBLE PRECISION ANORM, RCOND
137 * .. Array Arguments ..
138 DOUBLE PRECISION RWORK( * )
139 COMPLEX*16 A( LDA, * ), WORK( * )
142 * =====================================================================
145 DOUBLE PRECISION ONE, ZERO
146 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
148 * .. Local Scalars ..
151 INTEGER IX, KASE, KASE1
152 DOUBLE PRECISION AINVNM, SCALE, SL, SMLNUM, SU
158 * .. External Functions ..
161 DOUBLE PRECISION DLAMCH
162 EXTERNAL LSAME, IZAMAX, DLAMCH
164 * .. External Subroutines ..
165 EXTERNAL XERBLA, ZDRSCL, ZLACN2, ZLATRS
167 * .. Intrinsic Functions ..
168 INTRINSIC ABS, DBLE, DIMAG, MAX
170 * .. Statement Functions ..
171 DOUBLE PRECISION CABS1
173 * .. Statement Function definitions ..
174 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
176 * .. Executable Statements ..
178 * Test the input parameters.
181 ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )
182 IF( .NOT.ONENRM .AND. .NOT.LSAME( NORM, 'I' ) ) THEN
184 ELSE IF( N.LT.0 ) THEN
186 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
188 ELSE IF( ANORM.LT.ZERO ) THEN
192 CALL XERBLA( 'ZGECON', -INFO )
196 * Quick return if possible
202 ELSE IF( ANORM.EQ.ZERO ) THEN
206 SMLNUM = DLAMCH( 'Safe minimum' )
208 * Estimate the norm of inv(A).
219 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
221 IF( KASE.EQ.KASE1 ) THEN
223 * Multiply by inv(L).
225 CALL ZLATRS( 'Lower', 'No transpose', 'Unit', NORMIN, N, A,
226 $ LDA, WORK, SL, RWORK, INFO )
228 * Multiply by inv(U).
230 CALL ZLATRS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N,
231 $ A, LDA, WORK, SU, RWORK( N+1 ), INFO )
234 * Multiply by inv(U**H).
236 CALL ZLATRS( 'Upper', 'Conjugate transpose', 'Non-unit',
237 $ NORMIN, N, A, LDA, WORK, SU, RWORK( N+1 ),
240 * Multiply by inv(L**H).
242 CALL ZLATRS( 'Lower', 'Conjugate transpose', 'Unit', NORMIN,
243 $ N, A, LDA, WORK, SL, RWORK, INFO )
246 * Divide X by 1/(SL*SU) if doing so will not cause overflow.
250 IF( SCALE.NE.ONE ) THEN
251 IX = IZAMAX( N, WORK, 1 )
252 IF( SCALE.LT.CABS1( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
254 CALL ZDRSCL( N, SCALE, WORK, 1 )
259 * Compute the estimate of the reciprocal condition number.
262 $ RCOND = ( ONE / AINVNM ) / ANORM