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

◆ zla_syrcond_c()

double precision function zla_syrcond_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_SYRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for symmetric indefinite matrices.

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

Purpose:
!>
!>    ZLA_SYRCOND_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 ZSYTRF.
!> 
[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 ZSYTRF.
!> 
[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 135 of file zla_syrcond_c.f.

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