![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZHECON 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZHECON + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhecon.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhecon.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhecon.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE ZHECON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, 00022 * INFO ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER UPLO 00026 * INTEGER INFO, LDA, N 00027 * DOUBLE PRECISION ANORM, RCOND 00028 * .. 00029 * .. Array Arguments .. 00030 * INTEGER IPIV( * ) 00031 * COMPLEX*16 A( LDA, * ), WORK( * ) 00032 * .. 00033 * 00034 * 00035 *> \par Purpose: 00036 * ============= 00037 *> 00038 *> \verbatim 00039 *> 00040 *> ZHECON estimates the reciprocal of the condition number of a complex 00041 *> Hermitian matrix A using the factorization A = U*D*U**H or 00042 *> A = L*D*L**H computed by ZHETRF. 00043 *> 00044 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the 00045 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). 00046 *> \endverbatim 00047 * 00048 * Arguments: 00049 * ========== 00050 * 00051 *> \param[in] UPLO 00052 *> \verbatim 00053 *> UPLO is CHARACTER*1 00054 *> Specifies whether the details of the factorization are stored 00055 *> as an upper or lower triangular matrix. 00056 *> = 'U': Upper triangular, form is A = U*D*U**H; 00057 *> = 'L': Lower triangular, form is A = L*D*L**H. 00058 *> \endverbatim 00059 *> 00060 *> \param[in] N 00061 *> \verbatim 00062 *> N is INTEGER 00063 *> The order of the matrix A. N >= 0. 00064 *> \endverbatim 00065 *> 00066 *> \param[in] A 00067 *> \verbatim 00068 *> A is COMPLEX*16 array, dimension (LDA,N) 00069 *> The block diagonal matrix D and the multipliers used to 00070 *> obtain the factor U or L as computed by ZHETRF. 00071 *> \endverbatim 00072 *> 00073 *> \param[in] LDA 00074 *> \verbatim 00075 *> LDA is INTEGER 00076 *> The leading dimension of the array A. LDA >= max(1,N). 00077 *> \endverbatim 00078 *> 00079 *> \param[in] IPIV 00080 *> \verbatim 00081 *> IPIV is INTEGER array, dimension (N) 00082 *> Details of the interchanges and the block structure of D 00083 *> as determined by ZHETRF. 00084 *> \endverbatim 00085 *> 00086 *> \param[in] ANORM 00087 *> \verbatim 00088 *> ANORM is DOUBLE PRECISION 00089 *> The 1-norm of the original matrix A. 00090 *> \endverbatim 00091 *> 00092 *> \param[out] RCOND 00093 *> \verbatim 00094 *> RCOND is DOUBLE PRECISION 00095 *> The reciprocal of the condition number of the matrix A, 00096 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an 00097 *> estimate of the 1-norm of inv(A) computed in this routine. 00098 *> \endverbatim 00099 *> 00100 *> \param[out] WORK 00101 *> \verbatim 00102 *> WORK is COMPLEX*16 array, dimension (2*N) 00103 *> \endverbatim 00104 *> 00105 *> \param[out] INFO 00106 *> \verbatim 00107 *> INFO is INTEGER 00108 *> = 0: successful exit 00109 *> < 0: if INFO = -i, the i-th argument had an illegal value 00110 *> \endverbatim 00111 * 00112 * Authors: 00113 * ======== 00114 * 00115 *> \author Univ. of Tennessee 00116 *> \author Univ. of California Berkeley 00117 *> \author Univ. of Colorado Denver 00118 *> \author NAG Ltd. 00119 * 00120 *> \date November 2011 00121 * 00122 *> \ingroup complex16HEcomputational 00123 * 00124 * ===================================================================== 00125 SUBROUTINE ZHECON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, 00126 $ INFO ) 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 INFO, LDA, N 00136 DOUBLE PRECISION ANORM, RCOND 00137 * .. 00138 * .. Array Arguments .. 00139 INTEGER IPIV( * ) 00140 COMPLEX*16 A( LDA, * ), WORK( * ) 00141 * .. 00142 * 00143 * ===================================================================== 00144 * 00145 * .. Parameters .. 00146 DOUBLE PRECISION ONE, ZERO 00147 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) 00148 * .. 00149 * .. Local Scalars .. 00150 LOGICAL UPPER 00151 INTEGER I, KASE 00152 DOUBLE PRECISION AINVNM 00153 * .. 00154 * .. Local Arrays .. 00155 INTEGER ISAVE( 3 ) 00156 * .. 00157 * .. External Functions .. 00158 LOGICAL LSAME 00159 EXTERNAL LSAME 00160 * .. 00161 * .. External Subroutines .. 00162 EXTERNAL XERBLA, ZHETRS, ZLACN2 00163 * .. 00164 * .. Intrinsic Functions .. 00165 INTRINSIC MAX 00166 * .. 00167 * .. Executable Statements .. 00168 * 00169 * Test the input parameters. 00170 * 00171 INFO = 0 00172 UPPER = LSAME( UPLO, 'U' ) 00173 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00174 INFO = -1 00175 ELSE IF( N.LT.0 ) THEN 00176 INFO = -2 00177 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN 00178 INFO = -4 00179 ELSE IF( ANORM.LT.ZERO ) THEN 00180 INFO = -6 00181 END IF 00182 IF( INFO.NE.0 ) THEN 00183 CALL XERBLA( 'ZHECON', -INFO ) 00184 RETURN 00185 END IF 00186 * 00187 * Quick return if possible 00188 * 00189 RCOND = ZERO 00190 IF( N.EQ.0 ) THEN 00191 RCOND = ONE 00192 RETURN 00193 ELSE IF( ANORM.LE.ZERO ) THEN 00194 RETURN 00195 END IF 00196 * 00197 * Check that the diagonal matrix D is nonsingular. 00198 * 00199 IF( UPPER ) THEN 00200 * 00201 * Upper triangular storage: examine D from bottom to top 00202 * 00203 DO 10 I = N, 1, -1 00204 IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO ) 00205 $ RETURN 00206 10 CONTINUE 00207 ELSE 00208 * 00209 * Lower triangular storage: examine D from top to bottom. 00210 * 00211 DO 20 I = 1, N 00212 IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO ) 00213 $ RETURN 00214 20 CONTINUE 00215 END IF 00216 * 00217 * Estimate the 1-norm of the inverse. 00218 * 00219 KASE = 0 00220 30 CONTINUE 00221 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE ) 00222 IF( KASE.NE.0 ) THEN 00223 * 00224 * Multiply by inv(L*D*L**H) or inv(U*D*U**H). 00225 * 00226 CALL ZHETRS( UPLO, N, 1, A, LDA, IPIV, WORK, N, INFO ) 00227 GO TO 30 00228 END IF 00229 * 00230 * Compute the estimate of the reciprocal condition number. 00231 * 00232 IF( AINVNM.NE.ZERO ) 00233 $ RCOND = ( ONE / AINVNM ) / ANORM 00234 * 00235 RETURN 00236 * 00237 * End of ZHECON 00238 * 00239 END