LAPACK 3.3.0
|
00001 SUBROUTINE CTRT06( RCOND, RCONDC, UPLO, DIAG, N, A, LDA, RWORK, 00002 $ RAT ) 00003 * 00004 * -- LAPACK test routine (version 3.1) -- 00005 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. 00006 * November 2006 00007 * 00008 * .. Scalar Arguments .. 00009 CHARACTER DIAG, UPLO 00010 INTEGER LDA, N 00011 REAL RAT, RCOND, RCONDC 00012 * .. 00013 * .. Array Arguments .. 00014 REAL RWORK( * ) 00015 COMPLEX A( LDA, * ) 00016 * .. 00017 * 00018 * Purpose 00019 * ======= 00020 * 00021 * CTRT06 computes a test ratio comparing RCOND (the reciprocal 00022 * condition number of a triangular matrix A) and RCONDC, the estimate 00023 * computed by CTRCON. Information about the triangular matrix A is 00024 * used if one estimate is zero and the other is non-zero to decide if 00025 * underflow in the estimate is justified. 00026 * 00027 * Arguments 00028 * ========= 00029 * 00030 * RCOND (input) REAL 00031 * The estimate of the reciprocal condition number obtained by 00032 * forming the explicit inverse of the matrix A and computing 00033 * RCOND = 1/( norm(A) * norm(inv(A)) ). 00034 * 00035 * RCONDC (input) REAL 00036 * The estimate of the reciprocal condition number computed by 00037 * CTRCON. 00038 * 00039 * UPLO (input) CHARACTER 00040 * Specifies whether the matrix A is upper or lower triangular. 00041 * = 'U': Upper triangular 00042 * = 'L': Lower triangular 00043 * 00044 * DIAG (input) CHARACTER 00045 * Specifies whether or not the matrix A is unit triangular. 00046 * = 'N': Non-unit triangular 00047 * = 'U': Unit triangular 00048 * 00049 * N (input) INTEGER 00050 * The order of the matrix A. N >= 0. 00051 * 00052 * A (input) COMPLEX array, dimension (LDA,N) 00053 * The triangular matrix A. If UPLO = 'U', the leading n by n 00054 * upper triangular part of the array A contains the upper 00055 * triangular matrix, and the strictly lower triangular part of 00056 * A is not referenced. If UPLO = 'L', the leading n by n lower 00057 * triangular part of the array A contains the lower triangular 00058 * matrix, and the strictly upper triangular part of A is not 00059 * referenced. If DIAG = 'U', the diagonal elements of A are 00060 * also not referenced and are assumed to be 1. 00061 * 00062 * LDA (input) INTEGER 00063 * The leading dimension of the array A. LDA >= max(1,N). 00064 * 00065 * RWORK (workspace) REAL array, dimension (N) 00066 * 00067 * RAT (output) REAL 00068 * The test ratio. If both RCOND and RCONDC are nonzero, 00069 * RAT = MAX( RCOND, RCONDC )/MIN( RCOND, RCONDC ) - 1. 00070 * If RAT = 0, the two estimates are exactly the same. 00071 * 00072 * ===================================================================== 00073 * 00074 * .. Parameters .. 00075 REAL ZERO, ONE 00076 PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 ) 00077 * .. 00078 * .. Local Scalars .. 00079 REAL ANORM, BIGNUM, EPS, RMAX, RMIN 00080 * .. 00081 * .. External Functions .. 00082 REAL CLANTR, SLAMCH 00083 EXTERNAL CLANTR, SLAMCH 00084 * .. 00085 * .. Intrinsic Functions .. 00086 INTRINSIC MAX, MIN 00087 * .. 00088 * .. Executable Statements .. 00089 * 00090 EPS = SLAMCH( 'Epsilon' ) 00091 RMAX = MAX( RCOND, RCONDC ) 00092 RMIN = MIN( RCOND, RCONDC ) 00093 * 00094 * Do the easy cases first. 00095 * 00096 IF( RMIN.LT.ZERO ) THEN 00097 * 00098 * Invalid value for RCOND or RCONDC, return 1/EPS. 00099 * 00100 RAT = ONE / EPS 00101 * 00102 ELSE IF( RMIN.GT.ZERO ) THEN 00103 * 00104 * Both estimates are positive, return RMAX/RMIN - 1. 00105 * 00106 RAT = RMAX / RMIN - ONE 00107 * 00108 ELSE IF( RMAX.EQ.ZERO ) THEN 00109 * 00110 * Both estimates zero. 00111 * 00112 RAT = ZERO 00113 * 00114 ELSE 00115 * 00116 * One estimate is zero, the other is non-zero. If the matrix is 00117 * ill-conditioned, return the nonzero estimate multiplied by 00118 * 1/EPS; if the matrix is badly scaled, return the nonzero 00119 * estimate multiplied by BIGNUM/TMAX, where TMAX is the maximum 00120 * element in absolute value in A. 00121 * 00122 BIGNUM = ONE / SLAMCH( 'Safe minimum' ) 00123 ANORM = CLANTR( 'M', UPLO, DIAG, N, N, A, LDA, RWORK ) 00124 * 00125 RAT = RMAX*( MIN( BIGNUM / MAX( ONE, ANORM ), ONE / EPS ) ) 00126 END IF 00127 * 00128 RETURN 00129 * 00130 * End of CTRT06 00131 * 00132 END