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