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

◆ zla_porcond_c()

double precision function zla_porcond_c ( character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( ldaf, * ) af,
integer ldaf,
double precision, dimension( * ) c,
logical capply,
integer info,
complex*16, dimension( * ) work,
double precision, dimension( * ) rwork )

ZLA_PORCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for Hermitian positive-definite matrices.

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

Purpose:
!>
!>    ZLA_PORCOND_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 triangular factor U or L from the Cholesky factorization
!>     A = U**H*U or A = L*L**H, as computed by ZPOTRF.
!> 
[in]LDAF
!>          LDAF is INTEGER
!>     The leading dimension of the array AF.  LDAF >= max(1,N).
!> 
[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 127 of file zla_porcond_c.f.

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