![]() |
LAPACK
3.4.0
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZLA_PORCOND_X 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZLA_PORCOND_X + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_porcond_x.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_porcond_x.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_porcond_x.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * DOUBLE PRECISION FUNCTION ZLA_PORCOND_X( UPLO, N, A, LDA, AF, 00022 * LDAF, X, INFO, WORK, 00023 * RWORK ) 00024 * 00025 * .. Scalar Arguments .. 00026 * CHARACTER UPLO 00027 * INTEGER N, LDA, LDAF, INFO 00028 * .. 00029 * .. Array Arguments .. 00030 * COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * ) 00031 * DOUBLE PRECISION RWORK( * ) 00032 * .. 00033 * 00034 * 00035 *> \par Purpose: 00036 * ============= 00037 *> 00038 *> \verbatim 00039 *> 00040 *> ZLA_PORCOND_X Computes the infinity norm condition number of 00041 *> op(A) * diag(X) where X is a COMPLEX*16 vector. 00042 *> \endverbatim 00043 * 00044 * Arguments: 00045 * ========== 00046 * 00047 *> \param[in] UPLO 00048 *> \verbatim 00049 *> UPLO is CHARACTER*1 00050 *> = 'U': Upper triangle of A is stored; 00051 *> = 'L': Lower triangle of A is stored. 00052 *> \endverbatim 00053 *> 00054 *> \param[in] N 00055 *> \verbatim 00056 *> N is INTEGER 00057 *> The number of linear equations, i.e., the order of the 00058 *> matrix A. N >= 0. 00059 *> \endverbatim 00060 *> 00061 *> \param[in] A 00062 *> \verbatim 00063 *> A is COMPLEX*16 array, dimension (LDA,N) 00064 *> On entry, the N-by-N matrix A. 00065 *> \endverbatim 00066 *> 00067 *> \param[in] LDA 00068 *> \verbatim 00069 *> LDA is INTEGER 00070 *> The leading dimension of the array A. LDA >= max(1,N). 00071 *> \endverbatim 00072 *> 00073 *> \param[in] AF 00074 *> \verbatim 00075 *> AF is COMPLEX*16 array, dimension (LDAF,N) 00076 *> The triangular factor U or L from the Cholesky factorization 00077 *> A = U**H*U or A = L*L**H, as computed by ZPOTRF. 00078 *> \endverbatim 00079 *> 00080 *> \param[in] LDAF 00081 *> \verbatim 00082 *> LDAF is INTEGER 00083 *> The leading dimension of the array AF. LDAF >= max(1,N). 00084 *> \endverbatim 00085 *> 00086 *> \param[in] X 00087 *> \verbatim 00088 *> X is COMPLEX*16 array, dimension (N) 00089 *> The vector X in the formula op(A) * diag(X). 00090 *> \endverbatim 00091 *> 00092 *> \param[out] INFO 00093 *> \verbatim 00094 *> INFO is INTEGER 00095 *> = 0: Successful exit. 00096 *> i > 0: The ith argument is invalid. 00097 *> \endverbatim 00098 *> 00099 *> \param[in] WORK 00100 *> \verbatim 00101 *> WORK is COMPLEX*16 array, dimension (2*N). 00102 *> Workspace. 00103 *> \endverbatim 00104 *> 00105 *> \param[in] RWORK 00106 *> \verbatim 00107 *> RWORK is DOUBLE PRECISION array, dimension (N). 00108 *> Workspace. 00109 *> \endverbatim 00110 * 00111 * Authors: 00112 * ======== 00113 * 00114 *> \author Univ. of Tennessee 00115 *> \author Univ. of California Berkeley 00116 *> \author Univ. of Colorado Denver 00117 *> \author NAG Ltd. 00118 * 00119 *> \date November 2011 00120 * 00121 *> \ingroup complex16POcomputational 00122 * 00123 * ===================================================================== 00124 DOUBLE PRECISION FUNCTION ZLA_PORCOND_X( UPLO, N, A, LDA, AF, 00125 $ LDAF, X, INFO, WORK, 00126 $ RWORK ) 00127 * 00128 * -- LAPACK computational routine (version 3.4.0) -- 00129 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00130 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00131 * November 2011 00132 * 00133 * .. Scalar Arguments .. 00134 CHARACTER UPLO 00135 INTEGER N, LDA, LDAF, INFO 00136 * .. 00137 * .. Array Arguments .. 00138 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * ) 00139 DOUBLE PRECISION RWORK( * ) 00140 * .. 00141 * 00142 * ===================================================================== 00143 * 00144 * .. Local Scalars .. 00145 INTEGER KASE, I, J 00146 DOUBLE PRECISION AINVNM, ANORM, TMP 00147 LOGICAL UP 00148 COMPLEX*16 ZDUM 00149 * .. 00150 * .. Local Arrays .. 00151 INTEGER ISAVE( 3 ) 00152 * .. 00153 * .. External Functions .. 00154 LOGICAL LSAME 00155 EXTERNAL LSAME 00156 * .. 00157 * .. External Subroutines .. 00158 EXTERNAL ZLACN2, ZPOTRS, XERBLA 00159 * .. 00160 * .. Intrinsic Functions .. 00161 INTRINSIC ABS, MAX, REAL, DIMAG 00162 * .. 00163 * .. Statement Functions .. 00164 DOUBLE PRECISION CABS1 00165 * .. 00166 * .. Statement Function Definitions .. 00167 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) ) 00168 * .. 00169 * .. Executable Statements .. 00170 * 00171 ZLA_PORCOND_X = 0.0D+0 00172 * 00173 INFO = 0 00174 IF( N.LT.0 ) THEN 00175 INFO = -2 00176 END IF 00177 IF( INFO.NE.0 ) THEN 00178 CALL XERBLA( 'ZLA_PORCOND_X', -INFO ) 00179 RETURN 00180 END IF 00181 UP = .FALSE. 00182 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE. 00183 * 00184 * Compute norm of op(A)*op2(C). 00185 * 00186 ANORM = 0.0D+0 00187 IF ( UP ) THEN 00188 DO I = 1, N 00189 TMP = 0.0D+0 00190 DO J = 1, I 00191 TMP = TMP + CABS1( A( J, I ) * X( J ) ) 00192 END DO 00193 DO J = I+1, N 00194 TMP = TMP + CABS1( A( I, J ) * X( J ) ) 00195 END DO 00196 RWORK( I ) = TMP 00197 ANORM = MAX( ANORM, TMP ) 00198 END DO 00199 ELSE 00200 DO I = 1, N 00201 TMP = 0.0D+0 00202 DO J = 1, I 00203 TMP = TMP + CABS1( A( I, J ) * X( J ) ) 00204 END DO 00205 DO J = I+1, N 00206 TMP = TMP + CABS1( A( J, I ) * X( J ) ) 00207 END DO 00208 RWORK( I ) = TMP 00209 ANORM = MAX( ANORM, TMP ) 00210 END DO 00211 END IF 00212 * 00213 * Quick return if possible. 00214 * 00215 IF( N.EQ.0 ) THEN 00216 ZLA_PORCOND_X = 1.0D+0 00217 RETURN 00218 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN 00219 RETURN 00220 END IF 00221 * 00222 * Estimate the norm of inv(op(A)). 00223 * 00224 AINVNM = 0.0D+0 00225 * 00226 KASE = 0 00227 10 CONTINUE 00228 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE ) 00229 IF( KASE.NE.0 ) THEN 00230 IF( KASE.EQ.2 ) THEN 00231 * 00232 * Multiply by R. 00233 * 00234 DO I = 1, N 00235 WORK( I ) = WORK( I ) * RWORK( I ) 00236 END DO 00237 * 00238 IF ( UP ) THEN 00239 CALL ZPOTRS( 'U', N, 1, AF, LDAF, 00240 $ WORK, N, INFO ) 00241 ELSE 00242 CALL ZPOTRS( 'L', N, 1, AF, LDAF, 00243 $ WORK, N, INFO ) 00244 ENDIF 00245 * 00246 * Multiply by inv(X). 00247 * 00248 DO I = 1, N 00249 WORK( I ) = WORK( I ) / X( I ) 00250 END DO 00251 ELSE 00252 * 00253 * Multiply by inv(X**H). 00254 * 00255 DO I = 1, N 00256 WORK( I ) = WORK( I ) / X( I ) 00257 END DO 00258 * 00259 IF ( UP ) THEN 00260 CALL ZPOTRS( 'U', N, 1, AF, LDAF, 00261 $ WORK, N, INFO ) 00262 ELSE 00263 CALL ZPOTRS( 'L', N, 1, AF, LDAF, 00264 $ WORK, N, INFO ) 00265 END IF 00266 * 00267 * Multiply by R. 00268 * 00269 DO I = 1, N 00270 WORK( I ) = WORK( I ) * RWORK( I ) 00271 END DO 00272 END IF 00273 GO TO 10 00274 END IF 00275 * 00276 * Compute the estimate of the reciprocal condition number. 00277 * 00278 IF( AINVNM .NE. 0.0D+0 ) 00279 $ ZLA_PORCOND_X = 1.0D+0 / AINVNM 00280 * 00281 RETURN 00282 * 00283 END