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