LAPACK 3.3.1
Linear Algebra PACKage
|
00001 SUBROUTINE CCKGLM( NN, NVAL, MVAL, PVAL, NMATS, ISEED, THRESH, 00002 $ NMAX, A, AF, B, BF, X, WORK, RWORK, NIN, NOUT, 00003 $ INFO ) 00004 * 00005 * -- LAPACK test routine (version 3.1) -- 00006 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. 00007 * November 2006 00008 * 00009 * .. Scalar Arguments .. 00010 INTEGER INFO, NIN, NMATS, NMAX, NN, NOUT 00011 REAL THRESH 00012 * .. 00013 * .. Array Arguments .. 00014 INTEGER ISEED( 4 ), MVAL( * ), NVAL( * ), PVAL( * ) 00015 REAL RWORK( * ) 00016 COMPLEX A( * ), AF( * ), B( * ), BF( * ), WORK( * ), 00017 $ X( * ) 00018 * .. 00019 * 00020 * Purpose 00021 * ======= 00022 * 00023 * CCKGLM tests CGGGLM - subroutine for solving generalized linear 00024 * model problem. 00025 * 00026 * Arguments 00027 * ========= 00028 * 00029 * NN (input) INTEGER 00030 * The number of values of N, M and P contained in the vectors 00031 * NVAL, MVAL and PVAL. 00032 * 00033 * NVAL (input) INTEGER array, dimension (NN) 00034 * The values of the matrix row dimension N. 00035 * 00036 * MVAL (input) INTEGER array, dimension (NN) 00037 * The values of the matrix column dimension M. 00038 * 00039 * PVAL (input) INTEGER array, dimension (NN) 00040 * The values of the matrix column dimension P. 00041 * 00042 * NMATS (input) INTEGER 00043 * The number of matrix types to be tested for each combination 00044 * of matrix dimensions. If NMATS >= NTYPES (the maximum 00045 * number of matrix types), then all the different types are 00046 * generated for testing. If NMATS < NTYPES, another input line 00047 * is read to get the numbers of the matrix types to be used. 00048 * 00049 * ISEED (input/output) INTEGER array, dimension (4) 00050 * On entry, the seed of the random number generator. The array 00051 * elements should be between 0 and 4095, otherwise they will be 00052 * reduced mod 4096, and ISEED(4) must be odd. 00053 * On exit, the next seed in the random number sequence after 00054 * all the test matrices have been generated. 00055 * 00056 * THRESH (input) REAL 00057 * The threshold value for the test ratios. A result is 00058 * included in the output file if RESID >= THRESH. To have 00059 * every test ratio printed, use THRESH = 0. 00060 * 00061 * NMAX (input) INTEGER 00062 * The maximum value permitted for M or N, used in dimensioning 00063 * the work arrays. 00064 * 00065 * A (workspace) COMPLEX array, dimension (NMAX*NMAX) 00066 * 00067 * AF (workspace) COMPLEX array, dimension (NMAX*NMAX) 00068 * 00069 * B (workspace) COMPLEX array, dimension (NMAX*NMAX) 00070 * 00071 * BF (workspace) COMPLEX array, dimension (NMAX*NMAX) 00072 * 00073 * X (workspace) COMPLEX array, dimension (4*NMAX) 00074 * 00075 * RWORK (workspace) REAL array, dimension (NMAX) 00076 * 00077 * WORK (workspace) COMPLEX array, dimension (NMAX*NMAX) 00078 * 00079 * NIN (input) INTEGER 00080 * The unit number for input. 00081 * 00082 * NOUT (input) INTEGER 00083 * The unit number for output. 00084 * 00085 * INFO (output) INTEGER 00086 * = 0 : successful exit 00087 * > 0 : If CLATMS returns an error code, the absolute value 00088 * of it is returned. 00089 * 00090 * ===================================================================== 00091 * 00092 * .. Parameters .. 00093 INTEGER NTYPES 00094 PARAMETER ( NTYPES = 8 ) 00095 * .. 00096 * .. Local Scalars .. 00097 LOGICAL FIRSTT 00098 CHARACTER DISTA, DISTB, TYPE 00099 CHARACTER*3 PATH 00100 INTEGER I, IINFO, IK, IMAT, KLA, KLB, KUA, KUB, LDA, 00101 $ LDB, LWORK, M, MODEA, MODEB, N, NFAIL, NRUN, P 00102 REAL ANORM, BNORM, CNDNMA, CNDNMB, RESID 00103 * .. 00104 * .. Local Arrays .. 00105 LOGICAL DOTYPE( NTYPES ) 00106 * .. 00107 * .. External Functions .. 00108 COMPLEX CLARND 00109 EXTERNAL CLARND 00110 * .. 00111 * .. External Subroutines .. 00112 EXTERNAL ALAHDG, ALAREQ, ALASUM, CGLMTS, CLATMS, SLATB9 00113 * .. 00114 * .. Intrinsic Functions .. 00115 INTRINSIC ABS 00116 * .. 00117 * .. Executable Statements .. 00118 * 00119 * Initialize constants. 00120 * 00121 PATH( 1: 3 ) = 'GLM' 00122 INFO = 0 00123 NRUN = 0 00124 NFAIL = 0 00125 FIRSTT = .TRUE. 00126 CALL ALAREQ( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT ) 00127 LDA = NMAX 00128 LDB = NMAX 00129 LWORK = NMAX*NMAX 00130 * 00131 * Check for valid input values. 00132 * 00133 DO 10 IK = 1, NN 00134 M = MVAL( IK ) 00135 P = PVAL( IK ) 00136 N = NVAL( IK ) 00137 IF( M.GT.N .OR. N.GT.M+P ) THEN 00138 IF( FIRSTT ) THEN 00139 WRITE( NOUT, FMT = * ) 00140 FIRSTT = .FALSE. 00141 END IF 00142 WRITE( NOUT, FMT = 9997 )M, P, N 00143 END IF 00144 10 CONTINUE 00145 FIRSTT = .TRUE. 00146 * 00147 * Do for each value of M in MVAL. 00148 * 00149 DO 40 IK = 1, NN 00150 M = MVAL( IK ) 00151 P = PVAL( IK ) 00152 N = NVAL( IK ) 00153 IF( M.GT.N .OR. N.GT.M+P ) 00154 $ GO TO 40 00155 * 00156 DO 30 IMAT = 1, NTYPES 00157 * 00158 * Do the tests only if DOTYPE( IMAT ) is true. 00159 * 00160 IF( .NOT.DOTYPE( IMAT ) ) 00161 $ GO TO 30 00162 * 00163 * Set up parameters with SLATB9 and generate test 00164 * matrices A and B with CLATMS. 00165 * 00166 CALL SLATB9( PATH, IMAT, M, P, N, TYPE, KLA, KUA, KLB, KUB, 00167 $ ANORM, BNORM, MODEA, MODEB, CNDNMA, CNDNMB, 00168 $ DISTA, DISTB ) 00169 * 00170 CALL CLATMS( N, M, DISTA, ISEED, TYPE, RWORK, MODEA, CNDNMA, 00171 $ ANORM, KLA, KUA, 'No packing', A, LDA, WORK, 00172 $ IINFO ) 00173 IF( IINFO.NE.0 ) THEN 00174 WRITE( NOUT, FMT = 9999 )IINFO 00175 INFO = ABS( IINFO ) 00176 GO TO 30 00177 END IF 00178 * 00179 CALL CLATMS( N, P, DISTB, ISEED, TYPE, RWORK, MODEB, CNDNMB, 00180 $ BNORM, KLB, KUB, 'No packing', B, LDB, WORK, 00181 $ IINFO ) 00182 IF( IINFO.NE.0 ) THEN 00183 WRITE( NOUT, FMT = 9999 )IINFO 00184 INFO = ABS( IINFO ) 00185 GO TO 30 00186 END IF 00187 * 00188 * Generate random left hand side vector of GLM 00189 * 00190 DO 20 I = 1, N 00191 X( I ) = CLARND( 2, ISEED ) 00192 20 CONTINUE 00193 * 00194 CALL CGLMTS( N, M, P, A, AF, LDA, B, BF, LDB, X, 00195 $ X( NMAX+1 ), X( 2*NMAX+1 ), X( 3*NMAX+1 ), 00196 $ WORK, LWORK, RWORK, RESID ) 00197 * 00198 * Print information about the tests that did not 00199 * pass the threshold. 00200 * 00201 IF( RESID.GE.THRESH ) THEN 00202 IF( NFAIL.EQ.0 .AND. FIRSTT ) THEN 00203 FIRSTT = .FALSE. 00204 CALL ALAHDG( NOUT, PATH ) 00205 END IF 00206 WRITE( NOUT, FMT = 9998 )N, M, P, IMAT, 1, RESID 00207 NFAIL = NFAIL + 1 00208 END IF 00209 NRUN = NRUN + 1 00210 * 00211 30 CONTINUE 00212 40 CONTINUE 00213 * 00214 * Print a summary of the results. 00215 * 00216 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, 0 ) 00217 * 00218 9999 FORMAT( ' CLATMS in CCKGLM INFO = ', I5 ) 00219 9998 FORMAT( ' N=', I4, ' M=', I4, ', P=', I4, ', type ', I2, 00220 $ ', test ', I2, ', ratio=', G13.6 ) 00221 9997 FORMAT( ' *** Invalid input for GLM: M = ', I6, ', P = ', I6, 00222 $ ', N = ', I6, ';', / ' must satisfy M <= N <= M+P ', 00223 $ '(this set of values will be skipped)' ) 00224 RETURN 00225 * 00226 * End of CCKGLM 00227 * 00228 END