LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
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.

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

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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 131 of file zla_gercond_x.f.

134*
135* -- LAPACK computational routine --
136* -- LAPACK is a software package provided by Univ. of Tennessee, --
137* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138*
139* .. Scalar Arguments ..
140 CHARACTER TRANS
141 INTEGER N, LDA, LDAF, INFO
142* ..
143* .. Array Arguments ..
144 INTEGER IPIV( * )
145 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
146 DOUBLE PRECISION RWORK( * )
147* ..
148*
149* =====================================================================
150*
151* .. Local Scalars ..
152 LOGICAL NOTRANS
153 INTEGER KASE
154 DOUBLE PRECISION AINVNM, ANORM, TMP
155 INTEGER I, J
156 COMPLEX*16 ZDUM
157* ..
158* .. Local Arrays ..
159 INTEGER ISAVE( 3 )
160* ..
161* .. External Functions ..
162 LOGICAL LSAME
163 EXTERNAL lsame
164* ..
165* .. External Subroutines ..
166 EXTERNAL zlacn2, zgetrs, xerbla
167* ..
168* .. Intrinsic Functions ..
169 INTRINSIC abs, max, real, dimag
170* ..
171* .. Statement Functions ..
172 DOUBLE PRECISION CABS1
173* ..
174* .. Statement Function Definitions ..
175 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
176* ..
177* .. Executable Statements ..
178*
179 zla_gercond_x = 0.0d+0
180*
181 info = 0
182 notrans = lsame( trans, 'N' )
183 IF ( .NOT. notrans .AND. .NOT. lsame( trans, 'T' ) .AND. .NOT.
184 $ lsame( trans, 'C' ) ) THEN
185 info = -1
186 ELSE IF( n.LT.0 ) THEN
187 info = -2
188 ELSE IF( lda.LT.max( 1, n ) ) THEN
189 info = -4
190 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
191 info = -6
192 END IF
193 IF( info.NE.0 ) THEN
194 CALL xerbla( 'ZLA_GERCOND_X', -info )
195 RETURN
196 END IF
197*
198* Compute norm of op(A)*op2(C).
199*
200 anorm = 0.0d+0
201 IF ( notrans ) THEN
202 DO i = 1, n
203 tmp = 0.0d+0
204 DO j = 1, n
205 tmp = tmp + cabs1( a( i, j ) * x( j ) )
206 END DO
207 rwork( i ) = tmp
208 anorm = max( anorm, tmp )
209 END DO
210 ELSE
211 DO i = 1, n
212 tmp = 0.0d+0
213 DO j = 1, n
214 tmp = tmp + cabs1( a( j, i ) * x( j ) )
215 END DO
216 rwork( i ) = tmp
217 anorm = max( anorm, tmp )
218 END DO
219 END IF
220*
221* Quick return if possible.
222*
223 IF( n.EQ.0 ) THEN
224 zla_gercond_x = 1.0d+0
225 RETURN
226 ELSE IF( anorm .EQ. 0.0d+0 ) THEN
227 RETURN
228 END IF
229*
230* Estimate the norm of inv(op(A)).
231*
232 ainvnm = 0.0d+0
233*
234 kase = 0
235 10 CONTINUE
236 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
237 IF( kase.NE.0 ) THEN
238 IF( kase.EQ.2 ) THEN
239* Multiply by R.
240 DO i = 1, n
241 work( i ) = work( i ) * rwork( i )
242 END DO
243*
244 IF ( notrans ) THEN
245 CALL zgetrs( 'No transpose', n, 1, af, ldaf, ipiv,
246 $ work, n, info )
247 ELSE
248 CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf,
249 $ ipiv,
250 $ work, n, info )
251 ENDIF
252*
253* Multiply by inv(X).
254*
255 DO i = 1, n
256 work( i ) = work( i ) / x( i )
257 END DO
258 ELSE
259*
260* Multiply by inv(X**H).
261*
262 DO i = 1, n
263 work( i ) = work( i ) / x( i )
264 END DO
265*
266 IF ( notrans ) THEN
267 CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf,
268 $ 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)
Definition cblat2.f:3285
subroutine zgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
ZGETRS
Definition zgetrs.f:119
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:131
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: