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