LAPACK 3.3.0

ztrt06.f

Go to the documentation of this file.
00001       SUBROUTINE ZTRT06( 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       DOUBLE PRECISION   RAT, RCOND, RCONDC
00012 *     ..
00013 *     .. Array Arguments ..
00014       DOUBLE PRECISION   RWORK( * )
00015       COMPLEX*16         A( LDA, * )
00016 *     ..
00017 *
00018 *  Purpose
00019 *  =======
00020 *
00021 *  ZTRT06 computes a test ratio comparing RCOND (the reciprocal
00022 *  condition number of a triangular matrix A) and RCONDC, the estimate
00023 *  computed by ZTRCON.  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) DOUBLE PRECISION
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) DOUBLE PRECISION
00036 *          The estimate of the reciprocal condition number computed by
00037 *          ZTRCON.
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*16 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) DOUBLE PRECISION array, dimension (N)
00066 *
00067 *  RAT     (output) DOUBLE PRECISION
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       DOUBLE PRECISION   ZERO, ONE
00076       PARAMETER          ( ZERO = 0.0D+0, ONE = 1.0D+0 )
00077 *     ..
00078 *     .. Local Scalars ..
00079       DOUBLE PRECISION   ANORM, BIGNUM, EPS, RMAX, RMIN
00080 *     ..
00081 *     .. External Functions ..
00082       DOUBLE PRECISION   DLAMCH, ZLANTR
00083       EXTERNAL           DLAMCH, ZLANTR
00084 *     ..
00085 *     .. Intrinsic Functions ..
00086       INTRINSIC          MAX, MIN
00087 *     ..
00088 *     .. Executable Statements ..
00089 *
00090       EPS = DLAMCH( '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 / DLAMCH( 'Safe minimum' )
00123          ANORM = ZLANTR( '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 ZTRT06
00131 *
00132       END
 All Files Functions