 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ zla_hercond_x()

 double precision function zla_hercond_x ( character UPLO, 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_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices.

Purpose:
```    ZLA_HERCOND_X computes the infinity norm condition number of
op(A) * diag(X) where X is a COMPLEX*16 vector.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored.``` [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 block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by ZHETRF.``` [in] LDAF ``` LDAF is INTEGER The leading dimension of the array AF. LDAF >= 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] 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 130 of file zla_hercond_x.f.

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