 LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ zla_gercond_x()

 double precision function zla_gercond_x ( character TRANS, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( * ) X, integer INFO, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK )

ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices.

Purpose:
```    ZLA_GERCOND_X computes the infinity norm condition number of
op(A) * diag(X) where X is a COMPLEX*16 vector.```
Parameters
 [in] TRANS ``` TRANS is CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Conjugate Transpose = Transpose)``` [in] N ``` N is INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.``` [in] A ``` A is COMPLEX*16 array, dimension (LDA,N) On entry, the N-by-N matrix A.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).``` [in] AF ``` AF is COMPLEX*16 array, dimension (LDAF,N) The factors L and U from the factorization A = P*L*U as computed by ZGETRF.``` [in] LDAF ``` LDAF is INTEGER The leading dimension of the array AF. LDAF >= max(1,N).``` [in] IPIV ``` IPIV is INTEGER array, dimension (N) The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i).``` [in] X ``` X is COMPLEX*16 array, dimension (N) The vector X in the formula op(A) * diag(X).``` [out] INFO ``` INFO is INTEGER = 0: Successful exit. i > 0: The ith argument is invalid.``` [out] WORK ``` WORK is COMPLEX*16 array, dimension (2*N). Workspace.``` [out] RWORK ``` RWORK is DOUBLE PRECISION array, dimension (N). Workspace.```

Definition at line 133 of file zla_gercond_x.f.

136*
137* -- LAPACK computational routine --
138* -- LAPACK is a software package provided by Univ. of Tennessee, --
139* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
140*
141* .. Scalar Arguments ..
142 CHARACTER TRANS
143 INTEGER N, LDA, LDAF, INFO
144* ..
145* .. Array Arguments ..
146 INTEGER IPIV( * )
147 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
148 DOUBLE PRECISION RWORK( * )
149* ..
150*
151* =====================================================================
152*
153* .. Local Scalars ..
154 LOGICAL NOTRANS
155 INTEGER KASE
156 DOUBLE PRECISION AINVNM, ANORM, TMP
157 INTEGER I, J
158 COMPLEX*16 ZDUM
159* ..
160* .. Local Arrays ..
161 INTEGER ISAVE( 3 )
162* ..
163* .. External Functions ..
164 LOGICAL LSAME
165 EXTERNAL lsame
166* ..
167* .. External Subroutines ..
168 EXTERNAL zlacn2, zgetrs, xerbla
169* ..
170* .. Intrinsic Functions ..
171 INTRINSIC abs, max, real, dimag
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 zla_gercond_x = 0.0d+0
182*
183 info = 0
184 notrans = lsame( trans, 'N' )
185 IF ( .NOT. notrans .AND. .NOT. lsame( trans, 'T' ) .AND. .NOT.
186 \$ lsame( trans, 'C' ) ) THEN
187 info = -1
188 ELSE IF( n.LT.0 ) THEN
189 info = -2
190 ELSE IF( lda.LT.max( 1, n ) ) THEN
191 info = -4
192 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
193 info = -6
194 END IF
195 IF( info.NE.0 ) THEN
196 CALL xerbla( 'ZLA_GERCOND_X', -info )
197 RETURN
198 END IF
199*
200* Compute norm of op(A)*op2(C).
201*
202 anorm = 0.0d+0
203 IF ( notrans ) THEN
204 DO i = 1, n
205 tmp = 0.0d+0
206 DO j = 1, n
207 tmp = tmp + cabs1( a( i, j ) * x( j ) )
208 END DO
209 rwork( i ) = tmp
210 anorm = max( anorm, tmp )
211 END DO
212 ELSE
213 DO i = 1, n
214 tmp = 0.0d+0
215 DO j = 1, n
216 tmp = tmp + cabs1( a( j, i ) * x( j ) )
217 END DO
218 rwork( i ) = tmp
219 anorm = max( anorm, tmp )
220 END DO
221 END IF
222*
223* Quick return if possible.
224*
225 IF( n.EQ.0 ) THEN
226 zla_gercond_x = 1.0d+0
227 RETURN
228 ELSE IF( anorm .EQ. 0.0d+0 ) THEN
229 RETURN
230 END IF
231*
232* Estimate the norm of inv(op(A)).
233*
234 ainvnm = 0.0d+0
235*
236 kase = 0
237 10 CONTINUE
238 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
239 IF( kase.NE.0 ) THEN
240 IF( kase.EQ.2 ) THEN
241* Multiply by R.
242 DO i = 1, n
243 work( i ) = work( i ) * rwork( i )
244 END DO
245*
246 IF ( notrans ) THEN
247 CALL zgetrs( 'No transpose', n, 1, af, ldaf, ipiv,
248 \$ work, n, info )
249 ELSE
250 CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf, ipiv,
251 \$ work, n, info )
252 ENDIF
253*
254* Multiply by inv(X).
255*
256 DO i = 1, n
257 work( i ) = work( i ) / x( i )
258 END DO
259 ELSE
260*
261* Multiply by inv(X**H).
262*
263 DO i = 1, n
264 work( i ) = work( i ) / x( i )
265 END DO
266*
267 IF ( notrans ) THEN
268 CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf, ipiv,
269 \$ work, n, info )
270 ELSE
271 CALL zgetrs( 'No transpose', n, 1, af, ldaf, ipiv,
272 \$ work, n, info )
273 END IF
274*
275* Multiply by R.
276*
277 DO i = 1, n
278 work( i ) = work( i ) * rwork( i )
279 END DO
280 END IF
281 GO TO 10
282 END IF
283*
284* Compute the estimate of the reciprocal condition number.
285*
286 IF( ainvnm .NE. 0.0d+0 )
287 \$ zla_gercond_x = 1.0d+0 / ainvnm
288*
289 RETURN
290*
291* End of ZLA_GERCOND_X
292*
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zgetrs(TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZGETRS
Definition: zgetrs.f:121
double precision function zla_gercond_x(TRANS, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)
ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices.
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:133
Here is the call graph for this function:
Here is the caller graph for this function: