![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b SLATB5 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 SLATB5( PATH, IMAT, N, TYPE, KL, KU, ANORM, MODE, 00012 * CNDNUM, DIST ) 00013 * 00014 * .. Scalar Arguments .. 00015 * REAL ANORM, CNDNUM 00016 * INTEGER IMAT, KL, KU, MODE, N 00017 * CHARACTER DIST, TYPE 00018 * CHARACTER*3 PATH 00019 * .. 00020 * 00021 * 00022 *> \par Purpose: 00023 * ============= 00024 *> 00025 *> \verbatim 00026 *> 00027 *> SLATB5 sets parameters for the matrix generator based on the type 00028 *> of matrix to be generated. 00029 *> \endverbatim 00030 * 00031 * Arguments: 00032 * ========== 00033 * 00034 *> \param[in] PATH 00035 *> \verbatim 00036 *> PATH is CHARACTER*3 00037 *> The LAPACK path name. 00038 *> \endverbatim 00039 *> 00040 *> \param[in] IMAT 00041 *> \verbatim 00042 *> IMAT is INTEGER 00043 *> An integer key describing which matrix to generate for this 00044 *> path. 00045 *> \endverbatim 00046 *> 00047 *> \param[in] N 00048 *> \verbatim 00049 *> N is INTEGER 00050 *> The number of rows and columns in the matrix to be generated. 00051 *> \endverbatim 00052 *> 00053 *> \param[out] TYPE 00054 *> \verbatim 00055 *> TYPE is CHARACTER*1 00056 *> The type of the matrix to be generated: 00057 *> = 'S': symmetric matrix 00058 *> = 'P': symmetric positive (semi)definite matrix 00059 *> = 'N': nonsymmetric matrix 00060 *> \endverbatim 00061 *> 00062 *> \param[out] KL 00063 *> \verbatim 00064 *> KL is INTEGER 00065 *> The lower band width of the matrix to be generated. 00066 *> \endverbatim 00067 *> 00068 *> \param[out] KU 00069 *> \verbatim 00070 *> KU is INTEGER 00071 *> The upper band width of the matrix to be generated. 00072 *> \endverbatim 00073 *> 00074 *> \param[out] ANORM 00075 *> \verbatim 00076 *> ANORM is REAL 00077 *> The desired norm of the matrix to be generated. The diagonal 00078 *> matrix of singular values or eigenvalues is scaled by this 00079 *> value. 00080 *> \endverbatim 00081 *> 00082 *> \param[out] MODE 00083 *> \verbatim 00084 *> MODE is INTEGER 00085 *> A key indicating how to choose the vector of eigenvalues. 00086 *> \endverbatim 00087 *> 00088 *> \param[out] CNDNUM 00089 *> \verbatim 00090 *> CNDNUM is REAL 00091 *> The desired condition number. 00092 *> \endverbatim 00093 *> 00094 *> \param[out] DIST 00095 *> \verbatim 00096 *> DIST is CHARACTER*1 00097 *> The type of distribution to be used by the random number 00098 *> generator. 00099 *> \endverbatim 00100 * 00101 * Authors: 00102 * ======== 00103 * 00104 *> \author Univ. of Tennessee 00105 *> \author Univ. of California Berkeley 00106 *> \author Univ. of Colorado Denver 00107 *> \author NAG Ltd. 00108 * 00109 *> \date November 2011 00110 * 00111 *> \ingroup single_lin 00112 * 00113 * ===================================================================== 00114 SUBROUTINE SLATB5( PATH, IMAT, N, TYPE, KL, KU, ANORM, MODE, 00115 $ CNDNUM, DIST ) 00116 * 00117 * -- LAPACK test routine (version 3.4.0) -- 00118 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00119 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00120 * November 2011 00121 * 00122 * .. Scalar Arguments .. 00123 REAL ANORM, CNDNUM 00124 INTEGER IMAT, KL, KU, MODE, N 00125 CHARACTER DIST, TYPE 00126 CHARACTER*3 PATH 00127 * .. 00128 * 00129 * ===================================================================== 00130 * 00131 * .. Parameters .. 00132 REAL SHRINK, TENTH 00133 PARAMETER ( SHRINK = 0.25E0, TENTH = 0.1E+0 ) 00134 REAL ONE 00135 PARAMETER ( ONE = 1.0E+0 ) 00136 REAL TWO 00137 PARAMETER ( TWO = 2.0E+0 ) 00138 * .. 00139 * .. Local Scalars .. 00140 REAL BADC1, BADC2, EPS, LARGE, SMALL 00141 LOGICAL FIRST 00142 CHARACTER*2 C2 00143 * .. 00144 * .. External Functions .. 00145 REAL SLAMCH 00146 EXTERNAL SLAMCH 00147 * .. 00148 * .. Intrinsic Functions .. 00149 INTRINSIC MAX, SQRT 00150 * .. 00151 * .. External Subroutines .. 00152 EXTERNAL SLABAD 00153 * .. 00154 * .. Save statement .. 00155 SAVE EPS, SMALL, LARGE, BADC1, BADC2, FIRST 00156 * .. 00157 * .. Data statements .. 00158 DATA FIRST / .TRUE. / 00159 * .. 00160 * .. Executable Statements .. 00161 * 00162 * Set some constants for use in the subroutine. 00163 * 00164 IF( FIRST ) THEN 00165 FIRST = .FALSE. 00166 EPS = SLAMCH( 'Precision' ) 00167 BADC2 = TENTH / EPS 00168 BADC1 = SQRT( BADC2 ) 00169 SMALL = SLAMCH( 'Safe minimum' ) 00170 LARGE = ONE / SMALL 00171 * 00172 * If it looks like we're on a Cray, take the square root of 00173 * SMALL and LARGE to avoid overflow and underflow problems. 00174 * 00175 CALL SLABAD( SMALL, LARGE ) 00176 SMALL = SHRINK*( SMALL / EPS ) 00177 LARGE = ONE / SMALL 00178 END IF 00179 * 00180 C2 = PATH( 2: 3 ) 00181 * 00182 * Set some parameters 00183 * 00184 DIST = 'S' 00185 MODE = 3 00186 * 00187 * Set TYPE, the type of matrix to be generated. 00188 * 00189 TYPE = C2( 1: 1 ) 00190 * 00191 * Set the lower and upper bandwidths. 00192 * 00193 IF( IMAT.EQ.1 ) THEN 00194 KL = 0 00195 ELSE 00196 KL = MAX( N-1, 0 ) 00197 END IF 00198 KU = KL 00199 * 00200 * Set the condition number and norm.etc 00201 * 00202 IF( IMAT.EQ.3 ) THEN 00203 CNDNUM = 1.0E4 00204 MODE = 2 00205 ELSE IF( IMAT.EQ.4 ) THEN 00206 CNDNUM = 1.0E4 00207 MODE = 1 00208 ELSE IF( IMAT.EQ.5 ) THEN 00209 CNDNUM = 1.0E4 00210 MODE = 3 00211 ELSE IF( IMAT.EQ.6 ) THEN 00212 CNDNUM = BADC1 00213 ELSE IF( IMAT.EQ.7 ) THEN 00214 CNDNUM = BADC2 00215 ELSE 00216 CNDNUM = TWO 00217 END IF 00218 * 00219 IF( IMAT.EQ.8 ) THEN 00220 ANORM = SMALL 00221 ELSE IF( IMAT.EQ.9 ) THEN 00222 ANORM = LARGE 00223 ELSE 00224 ANORM = ONE 00225 END IF 00226 * 00227 IF( N.LE.1 ) 00228 $ CNDNUM = ONE 00229 * 00230 RETURN 00231 * 00232 * End of SLATB5 00233 * 00234 END