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