00001 SUBROUTINE ZDRVLS( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL, NNB,
00002 $ NBVAL, NXVAL, THRESH, TSTERR, A, COPYA, B,
00003 $ COPYB, C, S, COPYS, WORK, RWORK, IWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NM, NN, NNB, NNS, NOUT
00012 DOUBLE PRECISION THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ),
00017 $ NVAL( * ), NXVAL( * )
00018 DOUBLE PRECISION COPYS( * ), RWORK( * ), S( * )
00019 COMPLEX*16 A( * ), B( * ), C( * ), COPYA( * ), COPYB( * ),
00020 $ WORK( * )
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
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 INTEGER NTESTS
00120 PARAMETER ( NTESTS = 18 )
00121 INTEGER SMLSIZ
00122 PARAMETER ( SMLSIZ = 25 )
00123 DOUBLE PRECISION ONE, ZERO
00124 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00125 COMPLEX*16 CONE, CZERO
00126 PARAMETER ( CONE = ( 1.0D+0, 0.0D+0 ),
00127 $ CZERO = ( 0.0D+0, 0.0D+0 ) )
00128
00129
00130 CHARACTER TRANS
00131 CHARACTER*3 PATH
00132 INTEGER CRANK, I, IM, IN, INB, INFO, INS, IRANK,
00133 $ ISCALE, ITRAN, ITYPE, J, K, LDA, LDB, LDWORK,
00134 $ LWLSY, LWORK, M, MNMIN, N, NB, NCOLS, NERRS,
00135 $ NFAIL, NRHS, NROWS, NRUN, RANK
00136 DOUBLE PRECISION EPS, NORMA, NORMB, RCOND
00137
00138
00139 INTEGER ISEED( 4 ), ISEEDY( 4 )
00140 DOUBLE PRECISION RESULT( NTESTS )
00141
00142
00143 DOUBLE PRECISION DASUM, DLAMCH, ZQRT12, ZQRT14, ZQRT17
00144 EXTERNAL DASUM, DLAMCH, ZQRT12, ZQRT14, ZQRT17
00145
00146
00147 EXTERNAL ALAERH, ALAHD, ALASVM, DAXPY, DLASRT, XLAENV,
00148 $ ZDSCAL, ZERRLS, ZGELS, ZGELSD, ZGELSS, ZGELSX,
00149 $ ZGELSY, ZGEMM, ZLACPY, ZLARNV, ZQRT13, ZQRT15,
00150 $ ZQRT16
00151
00152
00153 INTRINSIC DBLE, MAX, MIN, SQRT
00154
00155
00156 LOGICAL LERR, OK
00157 CHARACTER*32 SRNAMT
00158 INTEGER INFOT, IOUNIT
00159
00160
00161 COMMON / INFOC / INFOT, IOUNIT, OK, LERR
00162 COMMON / SRNAMC / SRNAMT
00163
00164
00165 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00166
00167
00168
00169
00170
00171 PATH( 1: 1 ) = 'Zomplex precision'
00172 PATH( 2: 3 ) = 'LS'
00173 NRUN = 0
00174 NFAIL = 0
00175 NERRS = 0
00176 DO 10 I = 1, 4
00177 ISEED( I ) = ISEEDY( I )
00178 10 CONTINUE
00179 EPS = DLAMCH( 'Epsilon' )
00180
00181
00182
00183 RCOND = SQRT( EPS ) - ( SQRT( EPS )-EPS ) / 2
00184
00185
00186
00187 CALL XLAENV( 9, SMLSIZ )
00188 IF( TSTERR )
00189 $ CALL ZERRLS( PATH, NOUT )
00190
00191
00192
00193 IF( ( NM.EQ.0 .OR. NN.EQ.0 ) .AND. THRESH.EQ.ZERO )
00194 $ CALL ALAHD( NOUT, PATH )
00195 INFOT = 0
00196
00197 DO 140 IM = 1, NM
00198 M = MVAL( IM )
00199 LDA = MAX( 1, M )
00200
00201 DO 130 IN = 1, NN
00202 N = NVAL( IN )
00203 MNMIN = MIN( M, N )
00204 LDB = MAX( 1, M, N )
00205
00206 DO 120 INS = 1, NNS
00207 NRHS = NSVAL( INS )
00208 LWORK = MAX( 1, ( M+NRHS )*( N+2 ), ( N+NRHS )*( M+2 ),
00209 $ M*N+4*MNMIN+MAX( M, N ), 2*N+M )
00210
00211 DO 110 IRANK = 1, 2
00212 DO 100 ISCALE = 1, 3
00213 ITYPE = ( IRANK-1 )*3 + ISCALE
00214 IF( .NOT.DOTYPE( ITYPE ) )
00215 $ GO TO 100
00216
00217 IF( IRANK.EQ.1 ) THEN
00218
00219
00220
00221
00222
00223 CALL ZQRT13( ISCALE, M, N, COPYA, LDA, NORMA,
00224 $ ISEED )
00225 DO 40 INB = 1, NNB
00226 NB = NBVAL( INB )
00227 CALL XLAENV( 1, NB )
00228 CALL XLAENV( 3, NXVAL( INB ) )
00229
00230 DO 30 ITRAN = 1, 2
00231 IF( ITRAN.EQ.1 ) THEN
00232 TRANS = 'N'
00233 NROWS = M
00234 NCOLS = N
00235 ELSE
00236 TRANS = 'C'
00237 NROWS = N
00238 NCOLS = M
00239 END IF
00240 LDWORK = MAX( 1, NCOLS )
00241
00242
00243
00244 IF( NCOLS.GT.0 ) THEN
00245 CALL ZLARNV( 2, ISEED, NCOLS*NRHS,
00246 $ WORK )
00247 CALL ZDSCAL( NCOLS*NRHS,
00248 $ ONE / DBLE( NCOLS ), WORK,
00249 $ 1 )
00250 END IF
00251 CALL ZGEMM( TRANS, 'No transpose', NROWS,
00252 $ NRHS, NCOLS, CONE, COPYA, LDA,
00253 $ WORK, LDWORK, CZERO, B, LDB )
00254 CALL ZLACPY( 'Full', NROWS, NRHS, B, LDB,
00255 $ COPYB, LDB )
00256
00257
00258
00259 IF( M.GT.0 .AND. N.GT.0 ) THEN
00260 CALL ZLACPY( 'Full', M, N, COPYA, LDA,
00261 $ A, LDA )
00262 CALL ZLACPY( 'Full', NROWS, NRHS,
00263 $ COPYB, LDB, B, LDB )
00264 END IF
00265 SRNAMT = 'ZGELS '
00266 CALL ZGELS( TRANS, M, N, NRHS, A, LDA, B,
00267 $ LDB, WORK, LWORK, INFO )
00268
00269 IF( INFO.NE.0 )
00270 $ CALL ALAERH( PATH, 'ZGELS ', INFO, 0,
00271 $ TRANS, M, N, NRHS, -1, NB,
00272 $ ITYPE, NFAIL, NERRS,
00273 $ NOUT )
00274
00275
00276
00277 LDWORK = MAX( 1, NROWS )
00278 IF( NROWS.GT.0 .AND. NRHS.GT.0 )
00279 $ CALL ZLACPY( 'Full', NROWS, NRHS,
00280 $ COPYB, LDB, C, LDB )
00281 CALL ZQRT16( TRANS, M, N, NRHS, COPYA,
00282 $ LDA, B, LDB, C, LDB, RWORK,
00283 $ RESULT( 1 ) )
00284
00285 IF( ( ITRAN.EQ.1 .AND. M.GE.N ) .OR.
00286 $ ( ITRAN.EQ.2 .AND. M.LT.N ) ) THEN
00287
00288
00289
00290 RESULT( 2 ) = ZQRT17( TRANS, 1, M, N,
00291 $ NRHS, COPYA, LDA, B, LDB,
00292 $ COPYB, LDB, C, WORK,
00293 $ LWORK )
00294 ELSE
00295
00296
00297
00298 RESULT( 2 ) = ZQRT14( TRANS, M, N,
00299 $ NRHS, COPYA, LDA, B, LDB,
00300 $ WORK, LWORK )
00301 END IF
00302
00303
00304
00305
00306 DO 20 K = 1, 2
00307 IF( RESULT( K ).GE.THRESH ) THEN
00308 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00309 $ CALL ALAHD( NOUT, PATH )
00310 WRITE( NOUT, FMT = 9999 )TRANS, M,
00311 $ N, NRHS, NB, ITYPE, K,
00312 $ RESULT( K )
00313 NFAIL = NFAIL + 1
00314 END IF
00315 20 CONTINUE
00316 NRUN = NRUN + 2
00317 30 CONTINUE
00318 40 CONTINUE
00319 END IF
00320
00321
00322
00323
00324 CALL ZQRT15( ISCALE, IRANK, M, N, NRHS, COPYA, LDA,
00325 $ COPYB, LDB, COPYS, RANK, NORMA, NORMB,
00326 $ ISEED, WORK, LWORK )
00327
00328
00329
00330 DO 50 J = 1, N
00331 IWORK( J ) = 0
00332 50 CONTINUE
00333 LDWORK = MAX( 1, M )
00334
00335
00336
00337
00338
00339
00340
00341 CALL ZLACPY( 'Full', M, N, COPYA, LDA, A, LDA )
00342 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, B, LDB )
00343
00344 SRNAMT = 'ZGELSX'
00345 CALL ZGELSX( M, N, NRHS, A, LDA, B, LDB, IWORK,
00346 $ RCOND, CRANK, WORK, RWORK, INFO )
00347
00348 IF( INFO.NE.0 )
00349 $ CALL ALAERH( PATH, 'ZGELSX', INFO, 0, ' ', M, N,
00350 $ NRHS, -1, NB, ITYPE, NFAIL, NERRS,
00351 $ NOUT )
00352
00353
00354
00355
00356
00357
00358 RESULT( 3 ) = ZQRT12( CRANK, CRANK, A, LDA, COPYS,
00359 $ WORK, LWORK, RWORK )
00360
00361
00362
00363
00364 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, WORK,
00365 $ LDWORK )
00366 CALL ZQRT16( 'No transpose', M, N, NRHS, COPYA,
00367 $ LDA, B, LDB, WORK, LDWORK, RWORK,
00368 $ RESULT( 4 ) )
00369
00370
00371
00372
00373 RESULT( 5 ) = ZERO
00374 IF( M.GT.CRANK )
00375 $ RESULT( 5 ) = ZQRT17( 'No transpose', 1, M, N,
00376 $ NRHS, COPYA, LDA, B, LDB, COPYB,
00377 $ LDB, C, WORK, LWORK )
00378
00379
00380
00381
00382 RESULT( 6 ) = ZERO
00383
00384 IF( N.GT.CRANK )
00385 $ RESULT( 6 ) = ZQRT14( 'No transpose', M, N,
00386 $ NRHS, COPYA, LDA, B, LDB, WORK,
00387 $ LWORK )
00388
00389
00390
00391
00392 DO 60 K = 3, 6
00393 IF( RESULT( K ).GE.THRESH ) THEN
00394 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00395 $ CALL ALAHD( NOUT, PATH )
00396 WRITE( NOUT, FMT = 9998 )M, N, NRHS, 0,
00397 $ ITYPE, K, RESULT( K )
00398 NFAIL = NFAIL + 1
00399 END IF
00400 60 CONTINUE
00401 NRUN = NRUN + 4
00402
00403
00404
00405 DO 90 INB = 1, NNB
00406 NB = NBVAL( INB )
00407 CALL XLAENV( 1, NB )
00408 CALL XLAENV( 3, NXVAL( INB ) )
00409
00410
00411
00412
00413
00414
00415
00416
00417 CALL ZLACPY( 'Full', M, N, COPYA, LDA, A, LDA )
00418 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, B,
00419 $ LDB )
00420
00421
00422
00423 DO 70 J = 1, N
00424 IWORK( J ) = 0
00425 70 CONTINUE
00426
00427
00428
00429 LWLSY = MNMIN + MAX( 2*MNMIN, NB*( N+1 ),
00430 $ MNMIN+NB*NRHS )
00431 LWLSY = MAX( 1, LWLSY )
00432
00433 SRNAMT = 'ZGELSY'
00434 CALL ZGELSY( M, N, NRHS, A, LDA, B, LDB, IWORK,
00435 $ RCOND, CRANK, WORK, LWLSY, RWORK,
00436 $ INFO )
00437 IF( INFO.NE.0 )
00438 $ CALL ALAERH( PATH, 'ZGELSY', INFO, 0, ' ', M,
00439 $ N, NRHS, -1, NB, ITYPE, NFAIL,
00440 $ NERRS, NOUT )
00441
00442
00443
00444
00445
00446
00447 RESULT( 7 ) = ZQRT12( CRANK, CRANK, A, LDA,
00448 $ COPYS, WORK, LWORK, RWORK )
00449
00450
00451
00452
00453 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, WORK,
00454 $ LDWORK )
00455 CALL ZQRT16( 'No transpose', M, N, NRHS, COPYA,
00456 $ LDA, B, LDB, WORK, LDWORK, RWORK,
00457 $ RESULT( 8 ) )
00458
00459
00460
00461
00462 RESULT( 9 ) = ZERO
00463 IF( M.GT.CRANK )
00464 $ RESULT( 9 ) = ZQRT17( 'No transpose', 1, M,
00465 $ N, NRHS, COPYA, LDA, B, LDB,
00466 $ COPYB, LDB, C, WORK, LWORK )
00467
00468
00469
00470
00471 RESULT( 10 ) = ZERO
00472
00473 IF( N.GT.CRANK )
00474 $ RESULT( 10 ) = ZQRT14( 'No transpose', M, N,
00475 $ NRHS, COPYA, LDA, B, LDB,
00476 $ WORK, LWORK )
00477
00478
00479
00480
00481
00482
00483
00484 CALL ZLACPY( 'Full', M, N, COPYA, LDA, A, LDA )
00485 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, B,
00486 $ LDB )
00487 SRNAMT = 'ZGELSS'
00488 CALL ZGELSS( M, N, NRHS, A, LDA, B, LDB, S,
00489 $ RCOND, CRANK, WORK, LWORK, RWORK,
00490 $ INFO )
00491
00492 IF( INFO.NE.0 )
00493 $ CALL ALAERH( PATH, 'ZGELSS', INFO, 0, ' ', M,
00494 $ N, NRHS, -1, NB, ITYPE, NFAIL,
00495 $ NERRS, NOUT )
00496
00497
00498
00499
00500
00501
00502 IF( RANK.GT.0 ) THEN
00503 CALL DAXPY( MNMIN, -ONE, COPYS, 1, S, 1 )
00504 RESULT( 11 ) = DASUM( MNMIN, S, 1 ) /
00505 $ DASUM( MNMIN, COPYS, 1 ) /
00506 $ ( EPS*DBLE( MNMIN ) )
00507 ELSE
00508 RESULT( 11 ) = ZERO
00509 END IF
00510
00511
00512
00513 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, WORK,
00514 $ LDWORK )
00515 CALL ZQRT16( 'No transpose', M, N, NRHS, COPYA,
00516 $ LDA, B, LDB, WORK, LDWORK, RWORK,
00517 $ RESULT( 12 ) )
00518
00519
00520
00521 RESULT( 13 ) = ZERO
00522 IF( M.GT.CRANK )
00523 $ RESULT( 13 ) = ZQRT17( 'No transpose', 1, M,
00524 $ N, NRHS, COPYA, LDA, B, LDB,
00525 $ COPYB, LDB, C, WORK, LWORK )
00526
00527
00528
00529 RESULT( 14 ) = ZERO
00530 IF( N.GT.CRANK )
00531 $ RESULT( 14 ) = ZQRT14( 'No transpose', M, N,
00532 $ NRHS, COPYA, LDA, B, LDB,
00533 $ WORK, LWORK )
00534
00535
00536
00537
00538
00539
00540
00541 CALL XLAENV( 9, 25 )
00542
00543 CALL ZLACPY( 'Full', M, N, COPYA, LDA, A, LDA )
00544 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, B,
00545 $ LDB )
00546
00547 SRNAMT = 'ZGELSD'
00548 CALL ZGELSD( M, N, NRHS, A, LDA, B, LDB, S,
00549 $ RCOND, CRANK, WORK, LWORK, RWORK,
00550 $ IWORK, INFO )
00551 IF( INFO.NE.0 )
00552 $ CALL ALAERH( PATH, 'ZGELSD', INFO, 0, ' ', M,
00553 $ N, NRHS, -1, NB, ITYPE, NFAIL,
00554 $ NERRS, NOUT )
00555
00556
00557
00558 IF( RANK.GT.0 ) THEN
00559 CALL DAXPY( MNMIN, -ONE, COPYS, 1, S, 1 )
00560 RESULT( 15 ) = DASUM( MNMIN, S, 1 ) /
00561 $ DASUM( MNMIN, COPYS, 1 ) /
00562 $ ( EPS*DBLE( MNMIN ) )
00563 ELSE
00564 RESULT( 15 ) = ZERO
00565 END IF
00566
00567
00568
00569 CALL ZLACPY( 'Full', M, NRHS, COPYB, LDB, WORK,
00570 $ LDWORK )
00571 CALL ZQRT16( 'No transpose', M, N, NRHS, COPYA,
00572 $ LDA, B, LDB, WORK, LDWORK, RWORK,
00573 $ RESULT( 16 ) )
00574
00575
00576
00577 RESULT( 17 ) = ZERO
00578 IF( M.GT.CRANK )
00579 $ RESULT( 17 ) = ZQRT17( 'No transpose', 1, M,
00580 $ N, NRHS, COPYA, LDA, B, LDB,
00581 $ COPYB, LDB, C, WORK, LWORK )
00582
00583
00584
00585 RESULT( 18 ) = ZERO
00586 IF( N.GT.CRANK )
00587 $ RESULT( 18 ) = ZQRT14( 'No transpose', M, N,
00588 $ NRHS, COPYA, LDA, B, LDB,
00589 $ WORK, LWORK )
00590
00591
00592
00593
00594 DO 80 K = 7, NTESTS
00595 IF( RESULT( K ).GE.THRESH ) THEN
00596 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00597 $ CALL ALAHD( NOUT, PATH )
00598 WRITE( NOUT, FMT = 9998 )M, N, NRHS, NB,
00599 $ ITYPE, K, RESULT( K )
00600 NFAIL = NFAIL + 1
00601 END IF
00602 80 CONTINUE
00603 NRUN = NRUN + 12
00604
00605 90 CONTINUE
00606 100 CONTINUE
00607 110 CONTINUE
00608 120 CONTINUE
00609 130 CONTINUE
00610 140 CONTINUE
00611
00612
00613
00614 CALL ALASVM( PATH, NOUT, NFAIL, NRUN, NERRS )
00615
00616 9999 FORMAT( ' TRANS=''', A1, ''', M=', I5, ', N=', I5, ', NRHS=', I4,
00617 $ ', NB=', I4, ', type', I2, ', test(', I2, ')=', G12.5 )
00618 9998 FORMAT( ' M=', I5, ', N=', I5, ', NRHS=', I4, ', NB=', I4,
00619 $ ', type', I2, ', test(', I2, ')=', G12.5 )
00620 RETURN
00621
00622
00623
00624 END