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

◆ cla_porcond_c()

real function cla_porcond_c ( character  UPLO,
integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldaf, * )  AF,
integer  LDAF,
real, dimension( * )  C,
logical  CAPPLY,
integer  INFO,
complex, dimension( * )  WORK,
real, dimension( * )  RWORK 
)

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

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

Purpose:
    CLA_PORCOND_C Computes the infinity norm condition number of
    op(A) * inv(diag(C)) where C is a REAL 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]C
          C is REAL 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 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 128 of file cla_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 A( LDA, * ), AF( LDAF, * ), WORK( * )
142 REAL C( * ), RWORK( * )
143* ..
144*
145* =====================================================================
146*
147* .. Local Scalars ..
148 INTEGER KASE
149 REAL AINVNM, ANORM, TMP
150 INTEGER I, J
151 LOGICAL UP, UPPER
152 COMPLEX 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 clacn2, cpotrs, xerbla
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC abs, max, real, aimag
166* ..
167* .. Statement Functions ..
168 REAL CABS1
169* ..
170* .. Statement Function Definitions ..
171 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
172* ..
173* .. Executable Statements ..
174*
175 cla_porcond_c = 0.0e+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( 'CLA_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.0e+0
198 IF ( up ) THEN
199 DO i = 1, n
200 tmp = 0.0e+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.0e+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 cla_porcond_c = 1.0e+0
246 RETURN
247 ELSE IF( anorm .EQ. 0.0e+0 ) THEN
248 RETURN
249 END IF
250*
251* Estimate the norm of inv(op(A)).
252*
253 ainvnm = 0.0e+0
254*
255 kase = 0
256 10 CONTINUE
257 CALL clacn2( 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 cpotrs( 'U', n, 1, af, ldaf,
269 $ work, n, info )
270 ELSE
271 CALL cpotrs( '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 cpotrs( 'U', n, 1, af, ldaf,
294 $ work, n, info )
295 ELSE
296 CALL cpotrs( '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.0e+0 )
312 $ cla_porcond_c = 1.0e+0 / ainvnm
313*
314 RETURN
315*
316* End of CLA_PORCOND_C
317*
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
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
real function cla_porcond_c(UPLO, N, A, LDA, AF, LDAF, C, CAPPLY, INFO, WORK, RWORK)
CLA_PORCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for Hermitian positiv...
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: