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

◆ zla_porcond_x()

double precision function zla_porcond_x ( character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( ldaf, * ) af,
integer ldaf,
complex*16, dimension( * ) x,
integer info,
complex*16, dimension( * ) work,
double precision, dimension( * ) rwork )

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

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

Purpose:
!>
!>    ZLA_PORCOND_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 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]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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 120 of file zla_porcond_x.f.

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