![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZPBCON 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZPBCON + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpbcon.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpbcon.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbcon.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE ZPBCON( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK, 00022 * RWORK, INFO ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER UPLO 00026 * INTEGER INFO, KD, LDAB, N 00027 * DOUBLE PRECISION ANORM, RCOND 00028 * .. 00029 * .. Array Arguments .. 00030 * DOUBLE PRECISION RWORK( * ) 00031 * COMPLEX*16 AB( LDAB, * ), WORK( * ) 00032 * .. 00033 * 00034 * 00035 *> \par Purpose: 00036 * ============= 00037 *> 00038 *> \verbatim 00039 *> 00040 *> ZPBCON estimates the reciprocal of the condition number (in the 00041 *> 1-norm) of a complex Hermitian positive definite band matrix using 00042 *> the Cholesky factorization A = U**H*U or A = L*L**H computed by 00043 *> ZPBTRF. 00044 *> 00045 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the 00046 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). 00047 *> \endverbatim 00048 * 00049 * Arguments: 00050 * ========== 00051 * 00052 *> \param[in] UPLO 00053 *> \verbatim 00054 *> UPLO is CHARACTER*1 00055 *> = 'U': Upper triangular factor stored in AB; 00056 *> = 'L': Lower triangular factor stored in AB. 00057 *> \endverbatim 00058 *> 00059 *> \param[in] N 00060 *> \verbatim 00061 *> N is INTEGER 00062 *> The order of the matrix A. N >= 0. 00063 *> \endverbatim 00064 *> 00065 *> \param[in] KD 00066 *> \verbatim 00067 *> KD is INTEGER 00068 *> The number of superdiagonals of the matrix A if UPLO = 'U', 00069 *> or the number of sub-diagonals if UPLO = 'L'. KD >= 0. 00070 *> \endverbatim 00071 *> 00072 *> \param[in] AB 00073 *> \verbatim 00074 *> AB is COMPLEX*16 array, dimension (LDAB,N) 00075 *> The triangular factor U or L from the Cholesky factorization 00076 *> A = U**H*U or A = L*L**H of the band matrix A, stored in the 00077 *> first KD+1 rows of the array. The j-th column of U or L is 00078 *> stored in the j-th column of the array AB as follows: 00079 *> if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j; 00080 *> if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd). 00081 *> \endverbatim 00082 *> 00083 *> \param[in] LDAB 00084 *> \verbatim 00085 *> LDAB is INTEGER 00086 *> The leading dimension of the array AB. LDAB >= KD+1. 00087 *> \endverbatim 00088 *> 00089 *> \param[in] ANORM 00090 *> \verbatim 00091 *> ANORM is DOUBLE PRECISION 00092 *> The 1-norm (or infinity-norm) of the Hermitian band matrix A. 00093 *> \endverbatim 00094 *> 00095 *> \param[out] RCOND 00096 *> \verbatim 00097 *> RCOND is DOUBLE PRECISION 00098 *> The reciprocal of the condition number of the matrix A, 00099 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an 00100 *> estimate of the 1-norm of inv(A) computed in this routine. 00101 *> \endverbatim 00102 *> 00103 *> \param[out] WORK 00104 *> \verbatim 00105 *> WORK is COMPLEX*16 array, dimension (2*N) 00106 *> \endverbatim 00107 *> 00108 *> \param[out] RWORK 00109 *> \verbatim 00110 *> RWORK is DOUBLE PRECISION array, dimension (N) 00111 *> \endverbatim 00112 *> 00113 *> \param[out] INFO 00114 *> \verbatim 00115 *> INFO is INTEGER 00116 *> = 0: successful exit 00117 *> < 0: if INFO = -i, the i-th argument had an illegal value 00118 *> \endverbatim 00119 * 00120 * Authors: 00121 * ======== 00122 * 00123 *> \author Univ. of Tennessee 00124 *> \author Univ. of California Berkeley 00125 *> \author Univ. of Colorado Denver 00126 *> \author NAG Ltd. 00127 * 00128 *> \date November 2011 00129 * 00130 *> \ingroup complex16OTHERcomputational 00131 * 00132 * ===================================================================== 00133 SUBROUTINE ZPBCON( UPLO, N, KD, AB, LDAB, ANORM, RCOND, WORK, 00134 $ RWORK, INFO ) 00135 * 00136 * -- LAPACK computational routine (version 3.4.0) -- 00137 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00138 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00139 * November 2011 00140 * 00141 * .. Scalar Arguments .. 00142 CHARACTER UPLO 00143 INTEGER INFO, KD, LDAB, N 00144 DOUBLE PRECISION ANORM, RCOND 00145 * .. 00146 * .. Array Arguments .. 00147 DOUBLE PRECISION RWORK( * ) 00148 COMPLEX*16 AB( LDAB, * ), WORK( * ) 00149 * .. 00150 * 00151 * ===================================================================== 00152 * 00153 * .. Parameters .. 00154 DOUBLE PRECISION ONE, ZERO 00155 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) 00156 * .. 00157 * .. Local Scalars .. 00158 LOGICAL UPPER 00159 CHARACTER NORMIN 00160 INTEGER IX, KASE 00161 DOUBLE PRECISION AINVNM, SCALE, SCALEL, SCALEU, SMLNUM 00162 COMPLEX*16 ZDUM 00163 * .. 00164 * .. Local Arrays .. 00165 INTEGER ISAVE( 3 ) 00166 * .. 00167 * .. External Functions .. 00168 LOGICAL LSAME 00169 INTEGER IZAMAX 00170 DOUBLE PRECISION DLAMCH 00171 EXTERNAL LSAME, IZAMAX, DLAMCH 00172 * .. 00173 * .. External Subroutines .. 00174 EXTERNAL XERBLA, ZDRSCL, ZLACN2, ZLATBS 00175 * .. 00176 * .. Intrinsic Functions .. 00177 INTRINSIC ABS, DBLE, DIMAG 00178 * .. 00179 * .. Statement Functions .. 00180 DOUBLE PRECISION CABS1 00181 * .. 00182 * .. Statement Function definitions .. 00183 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) ) 00184 * .. 00185 * .. Executable Statements .. 00186 * 00187 * Test the input parameters. 00188 * 00189 INFO = 0 00190 UPPER = LSAME( UPLO, 'U' ) 00191 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00192 INFO = -1 00193 ELSE IF( N.LT.0 ) THEN 00194 INFO = -2 00195 ELSE IF( KD.LT.0 ) THEN 00196 INFO = -3 00197 ELSE IF( LDAB.LT.KD+1 ) THEN 00198 INFO = -5 00199 ELSE IF( ANORM.LT.ZERO ) THEN 00200 INFO = -6 00201 END IF 00202 IF( INFO.NE.0 ) THEN 00203 CALL XERBLA( 'ZPBCON', -INFO ) 00204 RETURN 00205 END IF 00206 * 00207 * Quick return if possible 00208 * 00209 RCOND = ZERO 00210 IF( N.EQ.0 ) THEN 00211 RCOND = ONE 00212 RETURN 00213 ELSE IF( ANORM.EQ.ZERO ) THEN 00214 RETURN 00215 END IF 00216 * 00217 SMLNUM = DLAMCH( 'Safe minimum' ) 00218 * 00219 * Estimate the 1-norm of the inverse. 00220 * 00221 KASE = 0 00222 NORMIN = 'N' 00223 10 CONTINUE 00224 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE ) 00225 IF( KASE.NE.0 ) THEN 00226 IF( UPPER ) THEN 00227 * 00228 * Multiply by inv(U**H). 00229 * 00230 CALL ZLATBS( 'Upper', 'Conjugate transpose', 'Non-unit', 00231 $ NORMIN, N, KD, AB, LDAB, WORK, SCALEL, RWORK, 00232 $ INFO ) 00233 NORMIN = 'Y' 00234 * 00235 * Multiply by inv(U). 00236 * 00237 CALL ZLATBS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N, 00238 $ KD, AB, LDAB, WORK, SCALEU, RWORK, INFO ) 00239 ELSE 00240 * 00241 * Multiply by inv(L). 00242 * 00243 CALL ZLATBS( 'Lower', 'No transpose', 'Non-unit', NORMIN, N, 00244 $ KD, AB, LDAB, WORK, SCALEL, RWORK, INFO ) 00245 NORMIN = 'Y' 00246 * 00247 * Multiply by inv(L**H). 00248 * 00249 CALL ZLATBS( 'Lower', 'Conjugate transpose', 'Non-unit', 00250 $ NORMIN, N, KD, AB, LDAB, WORK, SCALEU, RWORK, 00251 $ INFO ) 00252 END IF 00253 * 00254 * Multiply by 1/SCALE if doing so will not cause overflow. 00255 * 00256 SCALE = SCALEL*SCALEU 00257 IF( SCALE.NE.ONE ) THEN 00258 IX = IZAMAX( N, WORK, 1 ) 00259 IF( SCALE.LT.CABS1( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO ) 00260 $ GO TO 20 00261 CALL ZDRSCL( N, SCALE, WORK, 1 ) 00262 END IF 00263 GO TO 10 00264 END IF 00265 * 00266 * Compute the estimate of the reciprocal condition number. 00267 * 00268 IF( AINVNM.NE.ZERO ) 00269 $ RCOND = ( ONE / AINVNM ) / ANORM 00270 * 00271 20 CONTINUE 00272 * 00273 RETURN 00274 * 00275 * End of ZPBCON 00276 * 00277 END