1 *> \brief \b CLA_PORCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian positive-definite matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLA_PORCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cla_porcond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cla_porcond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cla_porcond_x.f">
21 * REAL FUNCTION CLA_PORCOND_X( UPLO, N, A, LDA, AF, LDAF, X, INFO,
24 * .. Scalar Arguments ..
26 * INTEGER N, LDA, LDAF, INFO
28 * .. Array Arguments ..
29 * COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
39 *> CLA_PORCOND_X Computes the infinity norm condition number of
40 *> op(A) * diag(X) where X is a COMPLEX vector.
48 *> UPLO is CHARACTER*1
49 *> = 'U': Upper triangle of A is stored;
50 *> = 'L': Lower triangle of A is stored.
56 *> The number of linear equations, i.e., the order of the
62 *> A is COMPLEX array, dimension (LDA,N)
63 *> On entry, the N-by-N matrix A.
69 *> The leading dimension of the array A. LDA >= max(1,N).
74 *> AF is COMPLEX array, dimension (LDAF,N)
75 *> The triangular factor U or L from the Cholesky factorization
76 *> A = U**H*U or A = L*L**H, as computed by CPOTRF.
82 *> The leading dimension of the array AF. LDAF >= max(1,N).
87 *> X is COMPLEX array, dimension (N)
88 *> The vector X in the formula op(A) * diag(X).
94 *> = 0: Successful exit.
95 *> i > 0: The ith argument is invalid.
100 *> WORK is COMPLEX array, dimension (2*N).
106 *> RWORK is REAL array, dimension (N).
113 *> \author Univ. of Tennessee
114 *> \author Univ. of California Berkeley
115 *> \author Univ. of Colorado Denver
118 *> \date September 2012
120 *> \ingroup complexPOcomputational
122 * =====================================================================
123 REAL FUNCTION CLA_PORCOND_X( UPLO, N, A, LDA, AF, LDAF, X, INFO,
126 * -- LAPACK computational routine (version 3.4.2) --
127 * -- LAPACK is a software package provided by Univ. of Tennessee, --
128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131 * .. Scalar Arguments ..
133 INTEGER N, LDA, LDAF, INFO
135 * .. Array Arguments ..
136 COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
140 * =====================================================================
142 * .. Local Scalars ..
144 REAL AINVNM, ANORM, TMP
151 * .. External Functions ..
155 * .. External Subroutines ..
156 EXTERNAL CLACN2, CPOTRS, XERBLA
158 * .. Intrinsic Functions ..
159 INTRINSIC ABS, MAX, REAL, AIMAG
161 * .. Statement Functions ..
164 * .. Statement Function Definitions ..
165 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
167 * .. Executable Statements ..
169 CLA_PORCOND_X = 0.0E+0
172 UPPER = LSAME( UPLO, 'U' )
173 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
175 ELSE IF ( N.LT.0 ) THEN
177 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
179 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
183 CALL XERBLA( 'CLA_PORCOND_X', -INFO )
187 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
189 * Compute norm of op(A)*op2(C).
196 TMP = TMP + CABS1( A( J, I ) * X( J ) )
199 TMP = TMP + CABS1( A( I, J ) * X( J ) )
202 ANORM = MAX( ANORM, TMP )
208 TMP = TMP + CABS1( A( I, J ) * X( J ) )
211 TMP = TMP + CABS1( A( J, I ) * X( J ) )
214 ANORM = MAX( ANORM, TMP )
218 * Quick return if possible.
221 CLA_PORCOND_X = 1.0E+0
223 ELSE IF( ANORM .EQ. 0.0E+0 ) THEN
227 * Estimate the norm of inv(op(A)).
233 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
240 WORK( I ) = WORK( I ) * RWORK( I )
244 CALL CPOTRS( 'U', N, 1, AF, LDAF,
247 CALL CPOTRS( 'L', N, 1, AF, LDAF,
251 * Multiply by inv(X).
254 WORK( I ) = WORK( I ) / X( I )
258 * Multiply by inv(X**H).
261 WORK( I ) = WORK( I ) / X( I )
265 CALL CPOTRS( 'U', N, 1, AF, LDAF,
268 CALL CPOTRS( 'L', N, 1, AF, LDAF,
275 WORK( I ) = WORK( I ) * RWORK( I )
281 * Compute the estimate of the reciprocal condition number.
283 IF( AINVNM .NE. 0.0E+0 )
284 $ CLA_PORCOND_X = 1.0E+0 / AINVNM