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

◆ cla_porcond_x()

real function cla_porcond_x ( character uplo,
integer n,
complex, dimension( lda, * ) a,
integer lda,
complex, dimension( ldaf, * ) af,
integer ldaf,
complex, dimension( * ) x,
integer info,
complex, dimension( * ) work,
real, dimension( * ) rwork )

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

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

Purpose:
!>
!>    CLA_PORCOND_X Computes the infinity norm condition number of
!>    op(A) * diag(X) where X is a COMPLEX 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 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 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 CPOTRF.
!> 
[in]LDAF
!>          LDAF is INTEGER
!>     The leading dimension of the array AF.  LDAF >= max(1,N).
!> 
[in]X
!>          X is COMPLEX 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 array, dimension (2*N).
!>     Workspace.
!> 
[out]RWORK
!>          RWORK is REAL array, dimension (N).
!>     Workspace.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 119 of file cla_porcond_x.f.

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