208 SUBROUTINE zdrvls( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL, NNB,
209 $ nbval, nxval, thresh, tsterr, a, copya, b,
210 $ copyb, c, s, copys, work, rwork, iwork, nout )
219 INTEGER NM, NN, NNB, NNS, NOUT
220 DOUBLE PRECISION THRESH
224 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ),
225 $ nval( * ), nxval( * )
226 DOUBLE PRECISION COPYS( * ), RWORK( * ), S( * )
227 COMPLEX*16 A( * ), B( * ), C( * ), COPYA( * ), COPYB( * ),
235 parameter ( ntests = 14 )
237 parameter ( smlsiz = 25 )
238 DOUBLE PRECISION ONE, ZERO
239 parameter ( one = 1.0d+0, zero = 0.0d+0 )
240 COMPLEX*16 CONE, CZERO
241 parameter ( cone = ( 1.0d+0, 0.0d+0 ),
242 $ czero = ( 0.0d+0, 0.0d+0 ) )
247 INTEGER CRANK, I, IM, IN, INB, INFO, INS, IRANK,
248 $ iscale, itran, itype, j, k, lda, ldb, ldwork,
249 $ lwlsy, lwork, m, mnmin, n, nb, ncols, nerrs,
250 $ nfail, nrhs, nrows, nrun, rank
251 DOUBLE PRECISION EPS, NORMA, NORMB, RCOND
254 INTEGER ISEED( 4 ), ISEEDY( 4 )
255 DOUBLE PRECISION RESULT( ntests )
258 DOUBLE PRECISION DASUM, DLAMCH, ZQRT12, ZQRT14, ZQRT17
259 EXTERNAL dasum, dlamch, zqrt12, zqrt14, zqrt17
268 INTRINSIC dble, max, min, sqrt
273 INTEGER INFOT, IOUNIT
276 COMMON / infoc / infot, iounit, ok, lerr
277 COMMON / srnamc / srnamt
280 DATA iseedy / 1988, 1989, 1990, 1991 /
286 path( 1: 1 ) =
'Zomplex precision'
292 iseed( i ) = iseedy( i )
294 eps = dlamch(
'Epsilon' )
298 rcond = sqrt( eps ) - ( sqrt( eps )-eps ) / 2
304 $
CALL zerrls( path, nout )
308 IF( ( nm.EQ.0 .OR. nn.EQ.0 ) .AND. thresh.EQ.zero )
309 $
CALL alahd( nout, path )
323 lwork = max( 1, ( m+nrhs )*( n+2 ), ( n+nrhs )*( m+2 ),
324 $ m*n+4*mnmin+max( m, n ), 2*n+m )
328 itype = ( irank-1 )*3 + iscale
329 IF( .NOT.dotype( itype ) )
332 IF( irank.EQ.1 )
THEN
338 CALL zqrt13( iscale, m, n, copya, lda, norma,
343 CALL xlaenv( 3, nxval( inb ) )
346 IF( itran.EQ.1 )
THEN
355 ldwork = max( 1, ncols )
359 IF( ncols.GT.0 )
THEN
360 CALL zlarnv( 2, iseed, ncols*nrhs,
363 $ one / dble( ncols ), work,
366 CALL zgemm( trans,
'No transpose', nrows,
367 $ nrhs, ncols, cone, copya, lda,
368 $ work, ldwork, czero, b, ldb )
369 CALL zlacpy(
'Full', nrows, nrhs, b, ldb,
374 IF( m.GT.0 .AND. n.GT.0 )
THEN
375 CALL zlacpy(
'Full', m, n, copya, lda,
377 CALL zlacpy(
'Full', nrows, nrhs,
378 $ copyb, ldb, b, ldb )
381 CALL zgels( trans, m, n, nrhs, a, lda, b,
382 $ ldb, work, lwork, info )
385 $
CALL alaerh( path,
'ZGELS ', info, 0,
386 $ trans, m, n, nrhs, -1, nb,
387 $ itype, nfail, nerrs,
392 ldwork = max( 1, nrows )
393 IF( nrows.GT.0 .AND. nrhs.GT.0 )
394 $
CALL zlacpy(
'Full', nrows, nrhs,
395 $ copyb, ldb, c, ldb )
396 CALL zqrt16( trans, m, n, nrhs, copya,
397 $ lda, b, ldb, c, ldb, rwork,
400 IF( ( itran.EQ.1 .AND. m.GE.n ) .OR.
401 $ ( itran.EQ.2 .AND. m.LT.n ) )
THEN
405 result( 2 ) = zqrt17( trans, 1, m, n,
406 $ nrhs, copya, lda, b, ldb,
407 $ copyb, ldb, c, work,
413 result( 2 ) = zqrt14( trans, m, n,
414 $ nrhs, copya, lda, b, ldb,
422 IF( result( k ).GE.thresh )
THEN
423 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
424 $
CALL alahd( nout, path )
425 WRITE( nout, fmt = 9999 )trans, m,
426 $ n, nrhs, nb, itype, k,
439 CALL zqrt15( iscale, irank, m, n, nrhs, copya, lda,
440 $ copyb, ldb, copys, rank, norma, normb,
441 $ iseed, work, lwork )
452 CALL xlaenv( 3, nxval( inb ) )
461 CALL zlacpy(
'Full', m, n, copya, lda, a, lda )
462 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, b,
473 lwlsy = mnmin + max( 2*mnmin, nb*( n+1 ),
475 lwlsy = max( 1, lwlsy )
478 CALL zgelsy( m, n, nrhs, a, lda, b, ldb, iwork,
479 $ rcond, crank, work, lwlsy, rwork,
482 $
CALL alaerh( path,
'ZGELSY', info, 0,
' ', m,
483 $ n, nrhs, -1, nb, itype, nfail,
491 result( 3 ) = zqrt12( crank, crank, a, lda,
492 $ copys, work, lwork, rwork )
497 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, work,
499 CALL zqrt16(
'No transpose', m, n, nrhs, copya,
500 $ lda, b, ldb, work, ldwork, rwork,
508 $ result( 5 ) = zqrt17(
'No transpose', 1, m,
509 $ n, nrhs, copya, lda, b, ldb,
510 $ copyb, ldb, c, work, lwork )
518 $ result( 6 ) = zqrt14(
'No transpose', m, n,
519 $ nrhs, copya, lda, b, ldb,
528 CALL zlacpy(
'Full', m, n, copya, lda, a, lda )
529 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, b,
532 CALL zgelss( m, n, nrhs, a, lda, b, ldb, s,
533 $ rcond, crank, work, lwork, rwork,
537 $
CALL alaerh( path,
'ZGELSS', info, 0,
' ', m,
538 $ n, nrhs, -1, nb, itype, nfail,
547 CALL daxpy( mnmin, -one, copys, 1, s, 1 )
548 result( 7 ) = dasum( mnmin, s, 1 ) /
549 $ dasum( mnmin, copys, 1 ) /
550 $ ( eps*dble( mnmin ) )
557 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, work,
559 CALL zqrt16(
'No transpose', m, n, nrhs, copya,
560 $ lda, b, ldb, work, ldwork, rwork,
567 $ result( 9 ) = zqrt17(
'No transpose', 1, m,
568 $ n, nrhs, copya, lda, b, ldb,
569 $ copyb, ldb, c, work, lwork )
575 $ result( 10 ) = zqrt14(
'No transpose', m, n,
576 $ nrhs, copya, lda, b, ldb,
587 CALL zlacpy(
'Full', m, n, copya, lda, a, lda )
588 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, b,
592 CALL zgelsd( m, n, nrhs, a, lda, b, ldb, s,
593 $ rcond, crank, work, lwork, rwork,
596 $
CALL alaerh( path,
'ZGELSD', info, 0,
' ', m,
597 $ n, nrhs, -1, nb, itype, nfail,
603 CALL daxpy( mnmin, -one, copys, 1, s, 1 )
604 result( 11 ) = dasum( mnmin, s, 1 ) /
605 $ dasum( mnmin, copys, 1 ) /
606 $ ( eps*dble( mnmin ) )
613 CALL zlacpy(
'Full', m, nrhs, copyb, ldb, work,
615 CALL zqrt16(
'No transpose', m, n, nrhs, copya,
616 $ lda, b, ldb, work, ldwork, rwork,
623 $ result( 13 ) = zqrt17(
'No transpose', 1, m,
624 $ n, nrhs, copya, lda, b, ldb,
625 $ copyb, ldb, c, work, lwork )
631 $ result( 14 ) = zqrt14(
'No transpose', m, n,
632 $ nrhs, copya, lda, b, ldb,
639 IF( result( k ).GE.thresh )
THEN
640 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
641 $
CALL alahd( nout, path )
642 WRITE( nout, fmt = 9998 )m, n, nrhs, nb,
643 $ itype, k, result( k )
658 CALL alasvm( path, nout, nfail, nrun, nerrs )
660 9999
FORMAT(
' TRANS=''', a1,
''', M=', i5,
', N=', i5,
', NRHS=', i4,
661 $
', NB=', i4,
', type', i2,
', test(', i2,
')=', g12.5 )
662 9998
FORMAT(
' M=', i5,
', N=', i5,
', NRHS=', i4,
', NB=', i4,
663 $
', type', i2,
', test(', i2,
')=', g12.5 )
subroutine alasvm(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASVM
subroutine dlasrt(ID, N, D, INFO)
DLASRT sorts numbers in increasing or decreasing order.
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine zqrt16(TRANS, M, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
ZQRT16
subroutine zgels(TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO)
ZGELS solves overdetermined or underdetermined systems for GE matrices
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlarnv(IDIST, ISEED, N, X)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine zgelsy(M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK, LWORK, RWORK, INFO)
ZGELSY solves overdetermined or underdetermined systems for GE matrices
subroutine zgelss(M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK, LWORK, RWORK, INFO)
ZGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine zgelsd(M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK, LWORK, RWORK, IWORK, INFO)
ZGELSD computes the minimum-norm solution to a linear least squares problem for GE matrices ...
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
subroutine zdrvls(DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL, NNB, NBVAL, NXVAL, THRESH, TSTERR, A, COPYA, B, COPYB, C, S, COPYS, WORK, RWORK, IWORK, NOUT)
ZDRVLS
subroutine zqrt13(SCALE, M, N, A, LDA, NORMA, ISEED)
ZQRT13
subroutine zerrls(PATH, NUNIT)
ZERRLS
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL
subroutine zqrt15(SCALE, RKSEL, M, N, NRHS, A, LDA, B, LDB, S, RANK, NORMA, NORMB, ISEED, WORK, LWORK)
ZQRT15