LAPACK 3.12.0
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 121 of file cla_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 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
134 REAL RWORK( * )
135* ..
136*
137* =====================================================================
138*
139* .. Local Scalars ..
140 INTEGER KASE, I, J
141 REAL AINVNM, ANORM, TMP
142 LOGICAL UP, UPPER
143 COMPLEX 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 clacn2, cpotrs, xerbla
154* ..
155* .. Intrinsic Functions ..
156 INTRINSIC abs, max, real, aimag
157* ..
158* .. Statement Functions ..
159 REAL CABS1
160* ..
161* .. Statement Function Definitions ..
162 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
163* ..
164* .. Executable Statements ..
165*
166 cla_porcond_x = 0.0e+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( 'CLA_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.0
189 IF ( up ) THEN
190 DO i = 1, n
191 tmp = 0.0e+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.0e+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 cla_porcond_x = 1.0e+0
219 RETURN
220 ELSE IF( anorm .EQ. 0.0e+0 ) THEN
221 RETURN
222 END IF
223*
224* Estimate the norm of inv(op(A)).
225*
226 ainvnm = 0.0e+0
227*
228 kase = 0
229 10 CONTINUE
230 CALL clacn2( 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 cpotrs( 'U', n, 1, af, ldaf,
242 $ work, n, info )
243 ELSE
244 CALL cpotrs( '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 cpotrs( 'U', n, 1, af, ldaf,
263 $ work, n, info )
264 ELSE
265 CALL cpotrs( '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.0e+0 )
281 $ cla_porcond_x = 1.0e+0 / ainvnm
282*
283 RETURN
284*
285* End of CLA_PORCOND_X
286*
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:133
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine cpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
CPOTRS
Definition cpotrs.f:110
Here is the call graph for this function:
Here is the caller graph for this function: