![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CTPT06 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 CTPT06( RCOND, RCONDC, UPLO, DIAG, N, AP, RWORK, RAT ) 00012 * 00013 * .. Scalar Arguments .. 00014 * CHARACTER DIAG, UPLO 00015 * INTEGER N 00016 * REAL RAT, RCOND, RCONDC 00017 * .. 00018 * .. Array Arguments .. 00019 * REAL RWORK( * ) 00020 * COMPLEX AP( * ) 00021 * .. 00022 * 00023 * 00024 *> \par Purpose: 00025 * ============= 00026 *> 00027 *> \verbatim 00028 *> 00029 *> CTPT06 computes a test ratio comparing RCOND (the reciprocal 00030 *> condition number of the triangular matrix A) and RCONDC, the estimate 00031 *> computed by CTPCON. Information about the triangular matrix is used 00032 *> 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 REAL 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 REAL 00050 *> The estimate of the reciprocal condition number computed by 00051 *> CTPCON. 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] AP 00077 *> \verbatim 00078 *> AP is COMPLEX array, dimension (N*(N+1)/2) 00079 *> The upper or lower triangular matrix A, packed columnwise in 00080 *> a linear array. The j-th column of A is stored in the array 00081 *> AP as follows: 00082 *> if UPLO = 'U', AP((j-1)*j/2 + i) = A(i,j) for 1<=i<=j; 00083 *> if UPLO = 'L', 00084 *> AP((j-1)*(n-j) + j*(j+1)/2 + i-j) = A(i,j) for j<=i<=n. 00085 *> \endverbatim 00086 *> 00087 *> \param[out] RWORK 00088 *> \verbatim 00089 *> RWORK is REAL array, dimension (N) 00090 *> \endverbatim 00091 *> 00092 *> \param[out] RAT 00093 *> \verbatim 00094 *> RAT is REAL 00095 *> The test ratio. If both RCOND and RCONDC are nonzero, 00096 *> RAT = MAX( RCOND, RCONDC )/MIN( RCOND, RCONDC ) - 1. 00097 *> If RAT = 0, the two estimates are exactly the same. 00098 *> \endverbatim 00099 * 00100 * Authors: 00101 * ======== 00102 * 00103 *> \author Univ. of Tennessee 00104 *> \author Univ. of California Berkeley 00105 *> \author Univ. of Colorado Denver 00106 *> \author NAG Ltd. 00107 * 00108 *> \date November 2011 00109 * 00110 *> \ingroup complex_lin 00111 * 00112 * ===================================================================== 00113 SUBROUTINE CTPT06( RCOND, RCONDC, UPLO, DIAG, N, AP, RWORK, RAT ) 00114 * 00115 * -- LAPACK test routine (version 3.4.0) -- 00116 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00117 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00118 * November 2011 00119 * 00120 * .. Scalar Arguments .. 00121 CHARACTER DIAG, UPLO 00122 INTEGER N 00123 REAL RAT, RCOND, RCONDC 00124 * .. 00125 * .. Array Arguments .. 00126 REAL RWORK( * ) 00127 COMPLEX AP( * ) 00128 * .. 00129 * 00130 * ===================================================================== 00131 * 00132 * .. Parameters .. 00133 REAL ZERO, ONE 00134 PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 ) 00135 * .. 00136 * .. Local Scalars .. 00137 REAL ANORM, BIGNUM, EPS, RMAX, RMIN 00138 * .. 00139 * .. External Functions .. 00140 REAL CLANTP, SLAMCH 00141 EXTERNAL CLANTP, SLAMCH 00142 * .. 00143 * .. Intrinsic Functions .. 00144 INTRINSIC MAX, MIN 00145 * .. 00146 * .. Executable Statements .. 00147 * 00148 EPS = SLAMCH( 'Epsilon' ) 00149 RMAX = MAX( RCOND, RCONDC ) 00150 RMIN = MIN( RCOND, RCONDC ) 00151 * 00152 * Do the easy cases first. 00153 * 00154 IF( RMIN.LT.ZERO ) THEN 00155 * 00156 * Invalid value for RCOND or RCONDC, return 1/EPS. 00157 * 00158 RAT = ONE / EPS 00159 * 00160 ELSE IF( RMIN.GT.ZERO ) THEN 00161 * 00162 * Both estimates are positive, return RMAX/RMIN - 1. 00163 * 00164 RAT = RMAX / RMIN - ONE 00165 * 00166 ELSE IF( RMAX.EQ.ZERO ) THEN 00167 * 00168 * Both estimates zero. 00169 * 00170 RAT = ZERO 00171 * 00172 ELSE 00173 * 00174 * One estimate is zero, the other is non-zero. If the matrix is 00175 * ill-conditioned, return the nonzero estimate multiplied by 00176 * 1/EPS; if the matrix is badly scaled, return the nonzero 00177 * estimate multiplied by BIGNUM/TMAX, where TMAX is the maximum 00178 * element in absolute value in A. 00179 * 00180 BIGNUM = ONE / SLAMCH( 'Safe minimum' ) 00181 ANORM = CLANTP( 'M', UPLO, DIAG, N, AP, RWORK ) 00182 * 00183 RAT = RMAX*( MIN( BIGNUM / MAX( ONE, ANORM ), ONE / EPS ) ) 00184 END IF 00185 * 00186 RETURN 00187 * 00188 * End of CTPT06 00189 * 00190 END