190 SUBROUTINE cdrvls( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL, NNB,
191 $ NBVAL, NXVAL, THRESH, TSTERR, A, COPYA, B,
192 $ COPYB, C, S, COPYS, NOUT )
200 INTEGER NM, NN, NNB, NNS, NOUT
205 INTEGER MVAL( * ), NBVAL( * ), NSVAL( * ),
206 $ nval( * ), nxval( * )
207 REAL COPYS( * ), S( * )
208 COMPLEX A( * ), B( * ), C( * ), COPYA( * ), COPYB( * )
215 PARAMETER ( NTESTS = 18 )
217 parameter( smlsiz = 25 )
219 parameter( one = 1.0e+0, zero = 0.0e+0 )
221 parameter( cone = ( 1.0e+0, 0.0e+0 ),
222 $ czero = ( 0.0e+0, 0.0e+0 ) )
227 INTEGER CRANK, I, IM, IMB, IN, INB, INFO, INS, IRANK,
228 $ iscale, itran, itype, j, k, lda, ldb, ldwork,
229 $ lwlsy, lwork, m, mnmin, n, nb, ncols, nerrs,
230 $ nfail, nrhs, nrows, nrun, rank, mb,
231 $ mmax, nmax, nsmax, liwork, lrwork,
232 $ lwork_cgels, lwork_cgelst, lwork_cgetsls,
233 $ lwork_cgelss, lwork_cgelsy, lwork_cgelsd,
234 $ lrwork_cgelsy, lrwork_cgelss, lrwork_cgelsd
235 REAL EPS, NORMA, NORMB, RCOND
238 INTEGER ISEED( 4 ), ISEEDY( 4 ), IWQ( 1 )
239 REAL RESULT( NTESTS ), RWQ( 1 )
243 COMPLEX,
ALLOCATABLE :: WORK (:)
244 REAL,
ALLOCATABLE :: RWORK (:), WORK2 (:)
245 INTEGER,
ALLOCATABLE :: IWORK (:)
248 REAL CQRT12, CQRT14, CQRT17, SASUM, SLAMCH
249 EXTERNAL CQRT12, CQRT14, CQRT17, SASUM, SLAMCH
258 INTRINSIC max, min, int, real, sqrt
263 INTEGER INFOT, IOUNIT
266 COMMON / infoc / infot, iounit, ok, lerr
267 COMMON / srnamc / srnamt
270 DATA iseedy / 1988, 1989, 1990, 1991 /
276 path( 1: 1 ) =
'Complex precision'
282 iseed( i ) = iseedy( i )
284 eps = slamch(
'Epsilon' )
288 rcond = sqrt( eps ) - ( sqrt( eps )-eps ) / 2
294 $
CALL cerrls( path, nout )
298 IF( ( nm.EQ.0 .OR. nn.EQ.0 ) .AND. thresh.EQ.zero )
299 $
CALL alahd( nout, path )
308 IF ( mval( i ).GT.mmax )
THEN
313 IF ( nval( i ).GT.nmax )
THEN
318 IF ( nsval( i ).GT.nsmax )
THEN
325 mnmin = max( min( m, n ), 1 )
330 lwork = max( 1, ( m+n )*nrhs,
331 $ ( n+nrhs )*( m+2 ), ( m+nrhs )*( n+2 ),
332 $ max( m+mnmin, nrhs*mnmin,2*n+m ),
333 $ max( m*n+4*mnmin+max(m,n), m*n+2*mnmin+4*n ) )
346 mnmin = max(min( m, n ),1)
352 itype = ( irank-1 )*3 + iscale
353 IF( dotype( itype ) )
THEN
354 IF( irank.EQ.1 )
THEN
356 IF( itran.EQ.1 )
THEN
363 CALL cgels( trans, m, n, nrhs, a, lda,
364 $ b, ldb, wq, -1, info )
365 lwork_cgels = int( wq( 1 ) )
367 CALL cgelst( trans, m, n, nrhs, a, lda,
368 $ b, ldb, wq, -1, info )
369 lwork_cgelst = int( wq( 1 ) )
371 CALL cgetsls( trans, m, n, nrhs, a, lda,
372 $ b, ldb, wq, -1, info )
373 lwork_cgetsls = int( wq( 1 ) )
377 CALL cgelsy( m, n, nrhs, a, lda, b, ldb,
378 $ iwq, rcond, crank, wq, -1, rwq,
380 lwork_cgelsy = int( wq( 1 ) )
383 CALL cgelss( m, n, nrhs, a, lda, b, ldb, s,
384 $ rcond, crank, wq, -1, rwq, info )
385 lwork_cgelss = int( wq( 1 ) )
386 lrwork_cgelss = 5*mnmin
388 CALL cgelsd( m, n, nrhs, a, lda, b, ldb, s,
389 $ rcond, crank, wq, -1, rwq, iwq,
391 lwork_cgelsd = int( wq( 1 ) )
392 lrwork_cgelsd = int( rwq( 1 ) )
394 liwork = max( liwork, n, iwq( 1 ) )
396 lrwork = max( lrwork, lrwork_cgelsy,
397 $ lrwork_cgelss, lrwork_cgelsd )
399 lwork = max( lwork, lwork_cgels, lwork_cgetsls,
400 $ lwork_cgelsy, lwork_cgelss,
411 ALLOCATE( work( lwork ) )
412 ALLOCATE( iwork( liwork ) )
413 ALLOCATE( rwork( lrwork ) )
414 ALLOCATE( work2( 2 * lwork ) )
422 mnmin = max(min( m, n ),1)
431 itype = ( irank-1 )*3 + iscale
432 IF( .NOT.dotype( itype ) )
437 IF( irank.EQ.1 )
THEN
441 CALL cqrt13( iscale, m, n, copya, lda, norma,
449 CALL xlaenv( 3, nxval( inb ) )
454 IF( itran.EQ.1 )
THEN
463 ldwork = max( 1, ncols )
467 IF( ncols.GT.0 )
THEN
468 CALL clarnv( 2, iseed, ncols*nrhs,
471 $ one / real( ncols ), work,
474 CALL cgemm( trans,
'No transpose', nrows,
475 $ nrhs, ncols, cone, copya, lda,
476 $ work, ldwork, czero, b, ldb )
477 CALL clacpy(
'Full', nrows, nrhs, b, ldb,
482 IF( m.GT.0 .AND. n.GT.0 )
THEN
483 CALL clacpy(
'Full', m, n, copya, lda,
485 CALL clacpy(
'Full', nrows, nrhs,
486 $ copyb, ldb, b, ldb )
489 CALL cgels( trans, m, n, nrhs, a, lda, b,
490 $ ldb, work, lwork, info )
493 $
CALL alaerh( path,
'CGELS ', info, 0,
494 $ trans, m, n, nrhs, -1, nb,
495 $ itype, nfail, nerrs,
503 IF( nrows.GT.0 .AND. nrhs.GT.0 )
504 $
CALL clacpy(
'Full', nrows, nrhs,
505 $ copyb, ldb, c, ldb )
506 CALL cqrt16( trans, m, n, nrhs, copya,
507 $ lda, b, ldb, c, ldb, rwork,
513 IF( ( itran.EQ.1 .AND. m.GE.n ) .OR.
514 $ ( itran.EQ.2 .AND. m.LT.n ) )
THEN
518 result( 2 ) = cqrt17( trans, 1, m, n,
519 $ nrhs, copya, lda, b, ldb,
520 $ copyb, ldb, c, work,
526 result( 2 ) = cqrt14( trans, m, n,
527 $ nrhs, copya, lda, b, ldb,
535 IF( result( k ).GE.thresh )
THEN
536 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
537 $
CALL alahd( nout, path )
538 WRITE( nout, fmt = 9999 )trans, m,
539 $ n, nrhs, nb, itype, k,
554 IF( irank.EQ.1 )
THEN
558 CALL cqrt13( iscale, m, n, copya, lda, norma,
566 CALL xlaenv( 3, nxval( inb ) )
571 IF( itran.EQ.1 )
THEN
580 ldwork = max( 1, ncols )
584 IF( ncols.GT.0 )
THEN
585 CALL clarnv( 2, iseed, ncols*nrhs,
588 $ one / real( ncols ), work,
591 CALL cgemm( trans,
'No transpose', nrows,
592 $ nrhs, ncols, cone, copya, lda,
593 $ work, ldwork, czero, b, ldb )
594 CALL clacpy(
'Full', nrows, nrhs, b, ldb,
599 IF( m.GT.0 .AND. n.GT.0 )
THEN
600 CALL clacpy(
'Full', m, n, copya, lda,
602 CALL clacpy(
'Full', nrows, nrhs,
603 $ copyb, ldb, b, ldb )
606 CALL cgelst( trans, m, n, nrhs, a, lda, b,
607 $ ldb, work, lwork, info )
610 $
CALL alaerh( path,
'CGELST', info, 0,
611 $ trans, m, n, nrhs, -1, nb,
612 $ itype, nfail, nerrs,
620 IF( nrows.GT.0 .AND. nrhs.GT.0 )
621 $
CALL clacpy(
'Full', nrows, nrhs,
622 $ copyb, ldb, c, ldb )
623 CALL cqrt16( trans, m, n, nrhs, copya,
624 $ lda, b, ldb, c, ldb, rwork,
630 IF( ( itran.EQ.1 .AND. m.GE.n ) .OR.
631 $ ( itran.EQ.2 .AND. m.LT.n ) )
THEN
635 result( 4 ) = cqrt17( trans, 1, m, n,
636 $ nrhs, copya, lda, b, ldb,
637 $ copyb, ldb, c, work,
643 result( 4 ) = cqrt14( trans, m, n,
644 $ nrhs, copya, lda, b, ldb,
652 IF( result( k ).GE.thresh )
THEN
653 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
654 $
CALL alahd( nout, path )
655 WRITE( nout, fmt = 9999 )trans, m,
656 $ n, nrhs, nb, itype, k,
671 IF( irank.EQ.1 )
THEN
675 CALL cqrt13( iscale, m, n, copya, lda, norma,
694 IF( itran.EQ.1 )
THEN
703 ldwork = max( 1, ncols )
707 IF( ncols.GT.0 )
THEN
708 CALL clarnv( 2, iseed, ncols*nrhs,
710 CALL cscal( ncols*nrhs,
711 $ cone / real( ncols ),
714 CALL cgemm( trans,
'No transpose',
715 $ nrows, nrhs, ncols, cone,
716 $ copya, lda, work, ldwork,
718 CALL clacpy(
'Full', nrows, nrhs,
719 $ b, ldb, copyb, ldb )
723 IF( m.GT.0 .AND. n.GT.0 )
THEN
724 CALL clacpy(
'Full', m, n,
725 $ copya, lda, a, lda )
726 CALL clacpy(
'Full', nrows, nrhs,
727 $ copyb, ldb, b, ldb )
730 CALL cgetsls( trans, m, n, nrhs, a,
731 $ lda, b, ldb, work, lwork,
734 $
CALL alaerh( path,
'CGETSLS ', info,
735 $ 0, trans, m, n, nrhs,
736 $ -1, nb, itype, nfail,
744 IF( nrows.GT.0 .AND. nrhs.GT.0 )
745 $
CALL clacpy(
'Full', nrows, nrhs,
746 $ copyb, ldb, c, ldb )
747 CALL cqrt16( trans, m, n, nrhs,
748 $ copya, lda, b, ldb,
755 IF( ( itran.EQ.1 .AND. m.GE.n ) .OR.
756 $ ( itran.EQ.2 .AND. m.LT.n ) )
THEN
762 result( 6 ) = cqrt17( trans, 1, m,
763 $ n, nrhs, copya, lda,
764 $ b, ldb, copyb, ldb,
770 result( 6 ) = cqrt14( trans, m, n,
771 $ nrhs, copya, lda, b,
779 IF( result( k ).GE.thresh )
THEN
780 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
781 $
CALL alahd( nout, path )
782 WRITE( nout, fmt = 9997 )trans,
783 $ m, n, nrhs, mb, nb, itype, k,
800 CALL cqrt15( iscale, irank, m, n, nrhs, copya, lda,
801 $ copyb, ldb, copys, rank, norma, normb,
802 $ iseed, work, lwork )
813 CALL xlaenv( 3, nxval( inb ) )
822 CALL clacpy(
'Full', m, n, copya, lda, a, lda )
823 CALL clacpy(
'Full', m, nrhs, copyb, ldb, b,
833 CALL cgelsy( m, n, nrhs, a, lda, b, ldb, iwork,
834 $ rcond, crank, work, lwlsy, rwork,
837 $
CALL alaerh( path,
'CGELSY', info, 0,
' ', m,
838 $ n, nrhs, -1, nb, itype, nfail,
846 result( 7 ) = cqrt12( crank, crank, a, lda,
847 $ copys, work, lwork, rwork )
852 CALL clacpy(
'Full', m, nrhs, copyb, ldb, work,
854 CALL cqrt16(
'No transpose', m, n, nrhs, copya,
855 $ lda, b, ldb, work, ldwork, rwork,
863 $ result( 9 ) = cqrt17(
'No transpose', 1, m,
864 $ n, nrhs, copya, lda, b, ldb,
865 $ copyb, ldb, c, work, lwork )
873 $ result( 10 ) = cqrt14(
'No transpose', m, n,
874 $ nrhs, copya, lda, b, ldb,
883 CALL clacpy(
'Full', m, n, copya, lda, a, lda )
884 CALL clacpy(
'Full', m, nrhs, copyb, ldb, b,
887 CALL cgelss( m, n, nrhs, a, lda, b, ldb, s,
888 $ rcond, crank, work, lwork, rwork,
892 $
CALL alaerh( path,
'CGELSS', info, 0,
' ', m,
893 $ n, nrhs, -1, nb, itype, nfail,
902 CALL saxpy( mnmin, -one, copys, 1, s, 1 )
903 result( 11 ) = sasum( mnmin, s, 1 ) /
904 $ sasum( mnmin, copys, 1 ) /
905 $ ( eps*real( mnmin ) )
912 CALL clacpy(
'Full', m, nrhs, copyb, ldb, work,
914 CALL cqrt16(
'No transpose', m, n, nrhs, copya,
915 $ lda, b, ldb, work, ldwork, rwork,
922 $ result( 13 ) = cqrt17(
'No transpose', 1, m,
923 $ n, nrhs, copya, lda, b, ldb,
924 $ copyb, ldb, c, work, lwork )
930 $ result( 14 ) = cqrt14(
'No transpose', m, n,
931 $ nrhs, copya, lda, b, ldb,
942 CALL clacpy(
'Full', m, n, copya, lda, a, lda )
943 CALL clacpy(
'Full', m, nrhs, copyb, ldb, b,
947 CALL cgelsd( m, n, nrhs, a, lda, b, ldb, s,
948 $ rcond, crank, work, lwork, rwork,
951 $
CALL alaerh( path,
'CGELSD', info, 0,
' ', m,
952 $ n, nrhs, -1, nb, itype, nfail,
958 CALL saxpy( mnmin, -one, copys, 1, s, 1 )
959 result( 15 ) = sasum( mnmin, s, 1 ) /
960 $ sasum( mnmin, copys, 1 ) /
961 $ ( eps*real( mnmin ) )
968 CALL clacpy(
'Full', m, nrhs, copyb, ldb, work,
970 CALL cqrt16(
'No transpose', m, n, nrhs, copya,
971 $ lda, b, ldb, work, ldwork, rwork,
978 $ result( 17 ) = cqrt17(
'No transpose', 1, m,
979 $ n, nrhs, copya, lda, b, ldb,
980 $ copyb, ldb, c, work, lwork )
986 $ result( 18 ) = cqrt14(
'No transpose', m, n,
987 $ nrhs, copya, lda, b, ldb,
994 IF( result( k ).GE.thresh )
THEN
995 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
996 $
CALL alahd( nout, path )
997 WRITE( nout, fmt = 9998 )m, n, nrhs, nb,
998 $ itype, k, result( k )
1013 CALL alasvm( path, nout, nfail, nrun, nerrs )
1015 9999
FORMAT(
' TRANS=''', a1,
''', M=', i5,
', N=', i5,
', NRHS=', i4,
1016 $
', NB=', i4,
', type', i2,
', test(', i2,
')=', g12.5 )
1017 9998
FORMAT(
' M=', i5,
', N=', i5,
', NRHS=', i4,
', NB=', i4,
1018 $
', type', i2,
', test(', i2,
')=', g12.5 )
1019 9997
FORMAT(
' TRANS=''', a1,
' M=', i5,
', N=', i5,
', NRHS=', i4,
1020 $
', MB=', i4,
', NB=', i4,
', type', i2,
1021 $
', test(', i2,
')=', g12.5 )
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine cdrvls(dotype, nm, mval, nn, nval, nns, nsval, nnb, nbval, nxval, thresh, tsterr, a, copya, b, copyb, c, s, copys, nout)
CDRVLS
subroutine cerrls(path, nunit)
CERRLS
subroutine cqrt13(scale, m, n, a, lda, norma, iseed)
CQRT13
subroutine cqrt15(scale, rksel, m, n, nrhs, a, lda, b, ldb, s, rank, norma, normb, iseed, work, lwork)
CQRT15
subroutine cqrt16(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CQRT16
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine cgels(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)
CGELS solves overdetermined or underdetermined systems for GE matrices
subroutine cgelsd(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, rwork, iwork, info)
CGELSD computes the minimum-norm solution to a linear least squares problem for GE matrices
subroutine cgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, rwork, info)
CGELSS solves overdetermined or underdetermined systems for GE matrices
subroutine cgelst(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)
CGELST solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization ...
subroutine cgelsy(m, n, nrhs, a, lda, b, ldb, jpvt, rcond, rank, work, lwork, rwork, info)
CGELSY solves overdetermined or underdetermined systems for GE matrices
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgetsls(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info)
CGETSLS
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine clarnv(idist, iseed, n, x)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine cscal(n, ca, cx, incx)
CSCAL