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