LAPACK 3.3.0
|
00001 SUBROUTINE ZLATB5( PATH, IMAT, N, TYPE, KL, KU, ANORM, MODE, 00002 $ CNDNUM, DIST ) 00003 * 00004 * -- LAPACK test routine (version 3.1) -- 00005 * Craig Lucas, University of Manchester / NAG Ltd. 00006 * October, 2008 00007 * 00008 * .. Scalar Arguments .. 00009 DOUBLE PRECISION ANORM, CNDNUM 00010 INTEGER IMAT, KL, KU, MODE, N 00011 CHARACTER DIST, TYPE 00012 CHARACTER*3 PATH 00013 * .. 00014 * 00015 * Purpose 00016 * ======= 00017 * 00018 * ZLATB5 sets parameters for the matrix generator based on the type 00019 * of matrix to be generated. 00020 * 00021 * Arguments 00022 * ========= 00023 * 00024 * PATH (input) CHARACTER*3 00025 * The LAPACK path name. 00026 * 00027 * IMAT (input) INTEGER 00028 * An integer key describing which matrix to generate for this 00029 * path. 00030 * 00031 * N (input) INTEGER 00032 * The number of rows and columns in the matrix to be generated. 00033 * 00034 * TYPE (output) CHARACTER*1 00035 * The type of the matrix to be generated: 00036 * = 'S': symmetric matrix 00037 * = 'P': symmetric positive (semi)definite matrix 00038 * = 'N': nonsymmetric matrix 00039 * 00040 * KL (output) INTEGER 00041 * The lower band width of the matrix to be generated. 00042 * 00043 * KU (output) INTEGER 00044 * The upper band width of the matrix to be generated. 00045 * 00046 * ANORM (output) DOUBLE PRECISION 00047 * The desired norm of the matrix to be generated. The diagonal 00048 * matrix of singular values or eigenvalues is scaled by this 00049 * value. 00050 * 00051 * MODE (output) INTEGER 00052 * A key indicating how to choose the vector of eigenvalues. 00053 * 00054 * CNDNUM (output) DOUBLE PRECISION 00055 * The desired condition number. 00056 * 00057 * DIST (output) CHARACTER*1 00058 * The type of distribution to be used by the random number 00059 * generator. 00060 * 00061 * ===================================================================== 00062 * 00063 * .. Parameters .. 00064 DOUBLE PRECISION SHRINK, TENTH 00065 PARAMETER ( SHRINK = 0.25D0, TENTH = 0.1D+0 ) 00066 DOUBLE PRECISION ONE 00067 PARAMETER ( ONE = 1.0D+0 ) 00068 DOUBLE PRECISION TWO 00069 PARAMETER ( TWO = 2.0D+0 ) 00070 * .. 00071 * .. Local Scalars .. 00072 DOUBLE PRECISION BADC1, BADC2, EPS, LARGE, SMALL 00073 LOGICAL FIRST 00074 CHARACTER*2 C2 00075 * .. 00076 * .. External Functions .. 00077 DOUBLE PRECISION DLAMCH 00078 EXTERNAL DLAMCH 00079 * .. 00080 * .. Intrinsic Functions .. 00081 INTRINSIC MAX, SQRT 00082 * .. 00083 * .. External Subroutines .. 00084 EXTERNAL DLABAD 00085 * .. 00086 * .. Save statement .. 00087 SAVE EPS, SMALL, LARGE, BADC1, BADC2, FIRST 00088 * .. 00089 * .. Data statements .. 00090 DATA FIRST / .TRUE. / 00091 * .. 00092 * .. Executable Statements .. 00093 * 00094 * Set some constants for use in the subroutine. 00095 * 00096 IF( FIRST ) THEN 00097 FIRST = .FALSE. 00098 EPS = DLAMCH( 'Precision' ) 00099 BADC2 = TENTH / EPS 00100 BADC1 = SQRT( BADC2 ) 00101 SMALL = DLAMCH( 'Safe minimum' ) 00102 LARGE = ONE / SMALL 00103 * 00104 * If it looks like we're on a Cray, take the square root of 00105 * SMALL and LARGE to avoid overflow and underflow problems. 00106 * 00107 CALL DLABAD( SMALL, LARGE ) 00108 SMALL = SHRINK*( SMALL / EPS ) 00109 LARGE = ONE / SMALL 00110 END IF 00111 * 00112 C2 = PATH( 2: 3 ) 00113 * 00114 * Set some parameters 00115 * 00116 DIST = 'S' 00117 MODE = 3 00118 * 00119 * Set TYPE, the type of matrix to be generated. 00120 * 00121 TYPE = C2( 1: 1 ) 00122 * 00123 * Set the lower and upper bandwidths. 00124 * 00125 IF( IMAT.EQ.1 ) THEN 00126 KL = 0 00127 ELSE 00128 KL = MAX( N-1, 0 ) 00129 END IF 00130 KU = KL 00131 * 00132 * Set the condition number and norm.etc 00133 * 00134 IF( IMAT.EQ.3 ) THEN 00135 CNDNUM = 1.0D12 00136 MODE = 2 00137 ELSE IF( IMAT.EQ.4 ) THEN 00138 CNDNUM = 1.0D12 00139 MODE = 1 00140 ELSE IF( IMAT.EQ.5 ) THEN 00141 CNDNUM = 1.0D12 00142 MODE = 3 00143 ELSE IF( IMAT.EQ.6 ) THEN 00144 CNDNUM = BADC1 00145 ELSE IF( IMAT.EQ.7 ) THEN 00146 CNDNUM = BADC2 00147 ELSE 00148 CNDNUM = TWO 00149 END IF 00150 * 00151 IF( IMAT.EQ.8 ) THEN 00152 ANORM = SMALL 00153 ELSE IF( IMAT.EQ.9 ) THEN 00154 ANORM = LARGE 00155 ELSE 00156 ANORM = ONE 00157 END IF 00158 * 00159 IF( N.LE.1 ) 00160 $ CNDNUM = ONE 00161 * 00162 RETURN 00163 * 00164 * End of ZLATB5 00165 * 00166 END