LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zla_hercond_c()

double precision function zla_hercond_c ( character  uplo,
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_HERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for Hermitian indefinite matrices.

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

Purpose:
    ZLA_HERCOND_C computes the infinity norm condition number of
    op(A) * inv(diag(C)) where C is a DOUBLE PRECISION 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]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.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 137 of file zla_hercond_c.f.

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