 LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

## ◆ zla_gercond_c()

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

ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general matrices.

Purpose:
```    ZLA_GERCOND_C computes the infinity norm condition number of
op(A) * inv(diag(C)) where C is a DOUBLE PRECISION 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] C ``` C is DOUBLE PRECISION array, dimension (N) The vector C in the formula op(A) * inv(diag(C)).``` [in] CAPPLY ``` CAPPLY is LOGICAL If .TRUE. then access the vector C in the formula above.``` [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 140 of file zla_gercond_c.f.

143 *
144 * -- LAPACK computational routine --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 *
148 * .. Scalar Arguments ..
149  CHARACTER TRANS
150  LOGICAL CAPPLY
151  INTEGER N, LDA, LDAF, INFO
152 * ..
153 * .. Array Arguments ..
154  INTEGER IPIV( * )
155  COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * )
156  DOUBLE PRECISION C( * ), RWORK( * )
157 * ..
158 *
159 * =====================================================================
160 *
161 * .. Local Scalars ..
162  LOGICAL NOTRANS
163  INTEGER KASE, I, J
164  DOUBLE PRECISION AINVNM, ANORM, TMP
165  COMPLEX*16 ZDUM
166 * ..
167 * .. Local Arrays ..
168  INTEGER ISAVE( 3 )
169 * ..
170 * .. External Functions ..
171  LOGICAL LSAME
172  EXTERNAL lsame
173 * ..
174 * .. External Subroutines ..
175  EXTERNAL zlacn2, zgetrs, xerbla
176 * ..
177 * .. Intrinsic Functions ..
178  INTRINSIC abs, max, real, dimag
179 * ..
180 * .. Statement Functions ..
181  DOUBLE PRECISION CABS1
182 * ..
183 * .. Statement Function Definitions ..
184  cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
185 * ..
186 * .. Executable Statements ..
187  zla_gercond_c = 0.0d+0
188 *
189  info = 0
190  notrans = lsame( trans, 'N' )
191  IF ( .NOT. notrans .AND. .NOT. lsame( trans, 'T' ) .AND. .NOT.
192  \$ lsame( trans, 'C' ) ) THEN
193  info = -1
194  ELSE IF( n.LT.0 ) THEN
195  info = -2
196  ELSE IF( lda.LT.max( 1, n ) ) THEN
197  info = -4
198  ELSE IF( ldaf.LT.max( 1, n ) ) THEN
199  info = -6
200  END IF
201  IF( info.NE.0 ) THEN
202  CALL xerbla( 'ZLA_GERCOND_C', -info )
203  RETURN
204  END IF
205 *
206 * Compute norm of op(A)*op2(C).
207 *
208  anorm = 0.0d+0
209  IF ( notrans ) THEN
210  DO i = 1, n
211  tmp = 0.0d+0
212  IF ( capply ) THEN
213  DO j = 1, n
214  tmp = tmp + cabs1( a( i, j ) ) / c( j )
215  END DO
216  ELSE
217  DO j = 1, n
218  tmp = tmp + cabs1( a( i, j ) )
219  END DO
220  END IF
221  rwork( i ) = tmp
222  anorm = max( anorm, tmp )
223  END DO
224  ELSE
225  DO i = 1, n
226  tmp = 0.0d+0
227  IF ( capply ) THEN
228  DO j = 1, n
229  tmp = tmp + cabs1( a( j, i ) ) / c( j )
230  END DO
231  ELSE
232  DO j = 1, n
233  tmp = tmp + cabs1( a( j, i ) )
234  END DO
235  END IF
236  rwork( i ) = tmp
237  anorm = max( anorm, tmp )
238  END DO
239  END IF
240 *
241 * Quick return if possible.
242 *
243  IF( n.EQ.0 ) THEN
244  zla_gercond_c = 1.0d+0
245  RETURN
246  ELSE IF( anorm .EQ. 0.0d+0 ) THEN
247  RETURN
248  END IF
249 *
250 * Estimate the norm of inv(op(A)).
251 *
252  ainvnm = 0.0d+0
253 *
254  kase = 0
255  10 CONTINUE
256  CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
257  IF( kase.NE.0 ) THEN
258  IF( kase.EQ.2 ) THEN
259 *
260 * Multiply by R.
261 *
262  DO i = 1, n
263  work( i ) = work( i ) * rwork( i )
264  END DO
265 *
266  IF (notrans) THEN
267  CALL zgetrs( 'No transpose', n, 1, af, ldaf, ipiv,
268  \$ work, n, info )
269  ELSE
270  CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf, ipiv,
271  \$ work, n, info )
272  ENDIF
273 *
274 * Multiply by inv(C).
275 *
276  IF ( capply ) THEN
277  DO i = 1, n
278  work( i ) = work( i ) * c( i )
279  END DO
280  END IF
281  ELSE
282 *
283 * Multiply by inv(C**H).
284 *
285  IF ( capply ) THEN
286  DO i = 1, n
287  work( i ) = work( i ) * c( i )
288  END DO
289  END IF
290 *
291  IF ( notrans ) THEN
292  CALL zgetrs( 'Conjugate transpose', n, 1, af, ldaf, ipiv,
293  \$ work, n, info )
294  ELSE
295  CALL zgetrs( 'No transpose', n, 1, af, ldaf, ipiv,
296  \$ work, n, info )
297  END IF
298 *
299 * Multiply by R.
300 *
301  DO i = 1, n
302  work( i ) = work( i ) * rwork( i )
303  END DO
304  END IF
305  GO TO 10
306  END IF
307 *
308 * Compute the estimate of the reciprocal condition number.
309 *
310  IF( ainvnm .NE. 0.0d+0 )
311  \$ zla_gercond_c = 1.0d+0 / ainvnm
312 *
313  RETURN
314 *
315 * End of ZLA_GERCOND_C
316 *
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_c(TRANS, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)
ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) 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: