00001 SUBROUTINE DCHKQR( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,
00002 $ NRHS, THRESH, TSTERR, NMAX, A, AF, AQ, AR, AC,
00003 $ B, X, XACT, TAU, WORK, RWORK, IWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NM, NMAX, NN, NNB, NOUT, NRHS
00012 DOUBLE PRECISION THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ),
00017 $ NXVAL( * )
00018 DOUBLE PRECISION A( * ), AC( * ), AF( * ), AQ( * ), AR( * ),
00019 $ B( * ), RWORK( * ), TAU( * ), WORK( * ),
00020 $ X( * ), XACT( * )
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 INTEGER NTESTS
00106 PARAMETER ( NTESTS = 9 )
00107 INTEGER NTYPES
00108 PARAMETER ( NTYPES = 8 )
00109 DOUBLE PRECISION ZERO
00110 PARAMETER ( ZERO = 0.0D0 )
00111
00112
00113 CHARACTER DIST, TYPE
00114 CHARACTER*3 PATH
00115 INTEGER I, IK, IM, IMAT, IN, INB, INFO, K, KL, KU, LDA,
00116 $ LWORK, M, MINMN, MODE, N, NB, NERRS, NFAIL, NK,
00117 $ NRUN, NT, NX
00118 DOUBLE PRECISION ANORM, CNDNUM
00119
00120
00121 INTEGER ISEED( 4 ), ISEEDY( 4 ), KVAL( 4 )
00122 DOUBLE PRECISION RESULT( NTESTS )
00123
00124
00125 LOGICAL DGENND
00126 EXTERNAL DGENND
00127
00128
00129 EXTERNAL ALAERH, ALAHD, ALASUM, DERRQR, DGEQRS, DGET02,
00130 $ DLACPY, DLARHS, DLATB4, DLATMS, DQRT01,
00131 $ DQRT01P, DQRT02, DQRT03, XLAENV
00132
00133
00134 INTRINSIC MAX, MIN
00135
00136
00137 LOGICAL LERR, OK
00138 CHARACTER*32 SRNAMT
00139 INTEGER INFOT, NUNIT
00140
00141
00142 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00143 COMMON / SRNAMC / SRNAMT
00144
00145
00146 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00147
00148
00149
00150
00151
00152 PATH( 1: 1 ) = 'Double precision'
00153 PATH( 2: 3 ) = 'QR'
00154 NRUN = 0
00155 NFAIL = 0
00156 NERRS = 0
00157 DO 10 I = 1, 4
00158 ISEED( I ) = ISEEDY( I )
00159 10 CONTINUE
00160
00161
00162
00163 IF( TSTERR )
00164 $ CALL DERRQR( PATH, NOUT )
00165 INFOT = 0
00166 CALL XLAENV( 2, 2 )
00167
00168 LDA = NMAX
00169 LWORK = NMAX*MAX( NMAX, NRHS )
00170
00171
00172
00173 DO 70 IM = 1, NM
00174 M = MVAL( IM )
00175
00176
00177
00178 DO 60 IN = 1, NN
00179 N = NVAL( IN )
00180 MINMN = MIN( M, N )
00181 DO 50 IMAT = 1, NTYPES
00182
00183
00184
00185 IF( .NOT.DOTYPE( IMAT ) )
00186 $ GO TO 50
00187
00188
00189
00190
00191 CALL DLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
00192 $ CNDNUM, DIST )
00193
00194 SRNAMT = 'DLATMS'
00195 CALL DLATMS( M, N, DIST, ISEED, TYPE, RWORK, MODE,
00196 $ CNDNUM, ANORM, KL, KU, 'No packing', A, LDA,
00197 $ WORK, INFO )
00198
00199
00200
00201 IF( INFO.NE.0 ) THEN
00202 CALL ALAERH( PATH, 'DLATMS', INFO, 0, ' ', M, N, -1,
00203 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00204 GO TO 50
00205 END IF
00206
00207
00208
00209
00210
00211 KVAL( 1 ) = MINMN
00212 KVAL( 2 ) = 0
00213 KVAL( 3 ) = 1
00214 KVAL( 4 ) = MINMN / 2
00215 IF( MINMN.EQ.0 ) THEN
00216 NK = 1
00217 ELSE IF( MINMN.EQ.1 ) THEN
00218 NK = 2
00219 ELSE IF( MINMN.LE.3 ) THEN
00220 NK = 3
00221 ELSE
00222 NK = 4
00223 END IF
00224
00225
00226
00227 DO 40 IK = 1, NK
00228 K = KVAL( IK )
00229
00230
00231
00232 DO 30 INB = 1, NNB
00233 NB = NBVAL( INB )
00234 CALL XLAENV( 1, NB )
00235 NX = NXVAL( INB )
00236 CALL XLAENV( 3, NX )
00237 DO I = 1, NTESTS
00238 RESULT( I ) = ZERO
00239 END DO
00240 NT = 2
00241 IF( IK.EQ.1 ) THEN
00242
00243
00244
00245 CALL DQRT01( M, N, A, AF, AQ, AR, LDA, TAU,
00246 $ WORK, LWORK, RWORK, RESULT( 1 ) )
00247
00248
00249
00250
00251 CALL DQRT01P( M, N, A, AF, AQ, AR, LDA, TAU,
00252 $ WORK, LWORK, RWORK, RESULT( 8 ) )
00253
00254 IF( .NOT. DGENND( M, N, AF, LDA ) )
00255 $ RESULT( 9 ) = 2*THRESH
00256 NT = NT + 1
00257 ELSE IF( M.GE.N ) THEN
00258
00259
00260
00261
00262 CALL DQRT02( M, N, K, A, AF, AQ, AR, LDA, TAU,
00263 $ WORK, LWORK, RWORK, RESULT( 1 ) )
00264 END IF
00265 IF( M.GE.K ) THEN
00266
00267
00268
00269
00270 CALL DQRT03( M, N, K, AF, AC, AR, AQ, LDA, TAU,
00271 $ WORK, LWORK, RWORK, RESULT( 3 ) )
00272 NT = NT + 4
00273
00274
00275
00276
00277
00278 IF( K.EQ.N .AND. INB.EQ.1 ) THEN
00279
00280
00281
00282
00283 SRNAMT = 'DLARHS'
00284 CALL DLARHS( PATH, 'New', 'Full',
00285 $ 'No transpose', M, N, 0, 0,
00286 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00287 $ ISEED, INFO )
00288
00289 CALL DLACPY( 'Full', M, NRHS, B, LDA, X,
00290 $ LDA )
00291 SRNAMT = 'DGEQRS'
00292 CALL DGEQRS( M, N, NRHS, AF, LDA, TAU, X,
00293 $ LDA, WORK, LWORK, INFO )
00294
00295
00296
00297 IF( INFO.NE.0 )
00298 $ CALL ALAERH( PATH, 'DGEQRS', INFO, 0, ' ',
00299 $ M, N, NRHS, -1, NB, IMAT,
00300 $ NFAIL, NERRS, NOUT )
00301
00302 CALL DGET02( 'No transpose', M, N, NRHS, A,
00303 $ LDA, X, LDA, B, LDA, RWORK,
00304 $ RESULT( 7 ) )
00305 NT = NT + 1
00306 END IF
00307 END IF
00308
00309
00310
00311
00312 DO 20 I = 1, NTESTS
00313 IF( RESULT( I ).GE.THRESH ) THEN
00314 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00315 $ CALL ALAHD( NOUT, PATH )
00316 WRITE( NOUT, FMT = 9999 )M, N, K, NB, NX,
00317 $ IMAT, I, RESULT( I )
00318 NFAIL = NFAIL + 1
00319 END IF
00320 20 CONTINUE
00321 NRUN = NRUN + NT
00322 30 CONTINUE
00323 40 CONTINUE
00324 50 CONTINUE
00325 60 CONTINUE
00326 70 CONTINUE
00327
00328
00329
00330 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00331
00332 9999 FORMAT( ' M=', I5, ', N=', I5, ', K=', I5, ', NB=', I4, ', NX=',
00333 $ I5, ', type ', I2, ', test(', I2, ')=', G12.5 )
00334 RETURN
00335
00336
00337
00338 END