![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DTRT06 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 * Definition: 00009 * =========== 00010 * 00011 * SUBROUTINE DTRT06( RCOND, RCONDC, UPLO, DIAG, N, A, LDA, WORK, 00012 * RAT ) 00013 * 00014 * .. Scalar Arguments .. 00015 * CHARACTER DIAG, UPLO 00016 * INTEGER LDA, N 00017 * DOUBLE PRECISION RAT, RCOND, RCONDC 00018 * .. 00019 * .. Array Arguments .. 00020 * DOUBLE PRECISION A( LDA, * ), WORK( * ) 00021 * .. 00022 * 00023 * 00024 *> \par Purpose: 00025 * ============= 00026 *> 00027 *> \verbatim 00028 *> 00029 *> DTRT06 computes a test ratio comparing RCOND (the reciprocal 00030 *> condition number of a triangular matrix A) and RCONDC, the estimate 00031 *> computed by DTRCON. Information about the triangular matrix A is 00032 *> used if one estimate is zero and the other is non-zero to decide if 00033 *> underflow in the estimate is justified. 00034 *> \endverbatim 00035 * 00036 * Arguments: 00037 * ========== 00038 * 00039 *> \param[in] RCOND 00040 *> \verbatim 00041 *> RCOND is DOUBLE PRECISION 00042 *> The estimate of the reciprocal condition number obtained by 00043 *> forming the explicit inverse of the matrix A and computing 00044 *> RCOND = 1/( norm(A) * norm(inv(A)) ). 00045 *> \endverbatim 00046 *> 00047 *> \param[in] RCONDC 00048 *> \verbatim 00049 *> RCONDC is DOUBLE PRECISION 00050 *> The estimate of the reciprocal condition number computed by 00051 *> DTRCON. 00052 *> \endverbatim 00053 *> 00054 *> \param[in] UPLO 00055 *> \verbatim 00056 *> UPLO is CHARACTER 00057 *> Specifies whether the matrix A is upper or lower triangular. 00058 *> = 'U': Upper triangular 00059 *> = 'L': Lower triangular 00060 *> \endverbatim 00061 *> 00062 *> \param[in] DIAG 00063 *> \verbatim 00064 *> DIAG is CHARACTER 00065 *> Specifies whether or not the matrix A is unit triangular. 00066 *> = 'N': Non-unit triangular 00067 *> = 'U': Unit triangular 00068 *> \endverbatim 00069 *> 00070 *> \param[in] N 00071 *> \verbatim 00072 *> N is INTEGER 00073 *> The order of the matrix A. N >= 0. 00074 *> \endverbatim 00075 *> 00076 *> \param[in] A 00077 *> \verbatim 00078 *> A is DOUBLE PRECISION array, dimension (LDA,N) 00079 *> The triangular matrix A. If UPLO = 'U', the leading n by n 00080 *> upper triangular part of the array A contains the upper 00081 *> triangular matrix, and the strictly lower triangular part of 00082 *> A is not referenced. If UPLO = 'L', the leading n by n lower 00083 *> triangular part of the array A contains the lower triangular 00084 *> matrix, and the strictly upper triangular part of A is not 00085 *> referenced. If DIAG = 'U', the diagonal elements of A are 00086 *> also not referenced and are assumed to be 1. 00087 *> \endverbatim 00088 *> 00089 *> \param[in] LDA 00090 *> \verbatim 00091 *> LDA is INTEGER 00092 *> The leading dimension of the array A. LDA >= max(1,N). 00093 *> \endverbatim 00094 *> 00095 *> \param[out] WORK 00096 *> \verbatim 00097 *> WORK is DOUBLE PRECISION array, dimension (N) 00098 *> \endverbatim 00099 *> 00100 *> \param[out] RAT 00101 *> \verbatim 00102 *> RAT is DOUBLE PRECISION 00103 *> The test ratio. If both RCOND and RCONDC are nonzero, 00104 *> RAT = MAX( RCOND, RCONDC )/MIN( RCOND, RCONDC ) - 1. 00105 *> If RAT = 0, the two estimates are exactly the same. 00106 *> \endverbatim 00107 * 00108 * Authors: 00109 * ======== 00110 * 00111 *> \author Univ. of Tennessee 00112 *> \author Univ. of California Berkeley 00113 *> \author Univ. of Colorado Denver 00114 *> \author NAG Ltd. 00115 * 00116 *> \date November 2011 00117 * 00118 *> \ingroup double_lin 00119 * 00120 * ===================================================================== 00121 SUBROUTINE DTRT06( RCOND, RCONDC, UPLO, DIAG, N, A, LDA, WORK, 00122 $ RAT ) 00123 * 00124 * -- LAPACK test routine (version 3.4.0) -- 00125 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00126 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00127 * November 2011 00128 * 00129 * .. Scalar Arguments .. 00130 CHARACTER DIAG, UPLO 00131 INTEGER LDA, N 00132 DOUBLE PRECISION RAT, RCOND, RCONDC 00133 * .. 00134 * .. Array Arguments .. 00135 DOUBLE PRECISION A( LDA, * ), WORK( * ) 00136 * .. 00137 * 00138 * ===================================================================== 00139 * 00140 * .. Parameters .. 00141 DOUBLE PRECISION ZERO, ONE 00142 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) 00143 * .. 00144 * .. Local Scalars .. 00145 DOUBLE PRECISION ANORM, BIGNUM, EPS, RMAX, RMIN, SMLNUM 00146 * .. 00147 * .. External Functions .. 00148 DOUBLE PRECISION DLAMCH, DLANTR 00149 EXTERNAL DLAMCH, DLANTR 00150 * .. 00151 * .. Intrinsic Functions .. 00152 INTRINSIC MAX, MIN 00153 * .. 00154 * .. External Subroutines .. 00155 EXTERNAL DLABAD 00156 * .. 00157 * .. Executable Statements .. 00158 * 00159 EPS = DLAMCH( 'Epsilon' ) 00160 RMAX = MAX( RCOND, RCONDC ) 00161 RMIN = MIN( RCOND, RCONDC ) 00162 * 00163 * Do the easy cases first. 00164 * 00165 IF( RMIN.LT.ZERO ) THEN 00166 * 00167 * Invalid value for RCOND or RCONDC, return 1/EPS. 00168 * 00169 RAT = ONE / EPS 00170 * 00171 ELSE IF( RMIN.GT.ZERO ) THEN 00172 * 00173 * Both estimates are positive, return RMAX/RMIN - 1. 00174 * 00175 RAT = RMAX / RMIN - ONE 00176 * 00177 ELSE IF( RMAX.EQ.ZERO ) THEN 00178 * 00179 * Both estimates zero. 00180 * 00181 RAT = ZERO 00182 * 00183 ELSE 00184 * 00185 * One estimate is zero, the other is non-zero. If the matrix is 00186 * ill-conditioned, return the nonzero estimate multiplied by 00187 * 1/EPS; if the matrix is badly scaled, return the nonzero 00188 * estimate multiplied by BIGNUM/TMAX, where TMAX is the maximum 00189 * element in absolute value in A. 00190 * 00191 SMLNUM = DLAMCH( 'Safe minimum' ) 00192 BIGNUM = ONE / SMLNUM 00193 CALL DLABAD( SMLNUM, BIGNUM ) 00194 ANORM = DLANTR( 'M', UPLO, DIAG, N, N, A, LDA, WORK ) 00195 * 00196 RAT = RMAX*( MIN( BIGNUM / MAX( ONE, ANORM ), ONE / EPS ) ) 00197 END IF 00198 * 00199 RETURN 00200 * 00201 * End of DTRT06 00202 * 00203 END