180 SUBROUTINE zchkqp3rk( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
181 $ NNB, NBVAL, NXVAL, THRESH, A, COPYA,
183 $ WORK, RWORK, IWORK, NOUT )
191 INTEGER NM, NN, NNB, NNS, NOUT
192 DOUBLE PRECISION THRESH
196 INTEGER IWORK( * ), NBVAL( * ), MVAL( * ), NVAL( * ),
197 $ NSVAL( * ), NXVAL( * )
198 DOUBLE PRECISION S( * ), RWORK( * )
199 COMPLEX*16 A( * ), COPYA( * ), B( * ), COPYB( * ),
200 $ TAU( * ), WORK( * )
207 PARAMETER ( NTYPES = 19 )
209 parameter( ntests = 5 )
210 DOUBLE PRECISION ONE, ZERO, BIGNUM
211 COMPLEX*16 CONE, CZERO
212 parameter( one = 1.0d+0, zero = 0.0d+0,
213 $ czero = ( 0.0d+0, 0.0d+0 ),
214 $ cone = ( 1.0d+0, 0.0d+0 ),
220 INTEGER I, IHIGH, ILOW, IM, IMAT, IN, INC_ZERO,
221 $ inb, ind_offset_gen,
222 $ ind_in, ind_out, ins, info,
223 $ istep, j, j_inc, j_first_nz, jb_zero,
224 $ kfact, kl, kmax, ku, lda, lw, lwork,
225 $ lwork_mqr, m, minmn, minmnb_gen, mode, n,
226 $ nb, nb_zero, nerrs, nfail, nb_gen, nrhs,
228 DOUBLE PRECISION ANORM, CNDNUM, EPS, ABSTOL, RELTOL,
229 $ DTEMP, MAXC2NRMK, RELMAXC2NRMK
232 INTEGER ISEED( 4 ), ISEEDY( 4 )
233 DOUBLE PRECISION RESULT( NTESTS ), RDUMMY( 1 )
236 DOUBLE PRECISION DLAMCH, ZQPT01, ZQRT11, ZQRT12, ZLANGE
237 EXTERNAL DLAMCH, ZQPT01, ZQRT11, ZQRT12, ZLANGE
245 INTRINSIC abs, dble, max, min, mod
250 INTEGER INFOT, IOUNIT, ZUNMQR_LWORK
253 COMMON / infoc / infot, iounit, ok, lerr
254 COMMON / srnamc / srnamt
257 DATA iseedy / 1988, 1989, 1990, 1991 /
263 path( 1: 1 ) =
'Zomplex precision'
269 iseed( i ) = iseedy( i )
271 eps = dlamch(
'Epsilon' )
287 lwork = max( 1, m*max( m, n )+4*minmn+max( m, n ),
288 $ m*n + 2*minmn + 4*n )
299 CALL zlatb4( path, 14, m, nrhs,
TYPE, kl, ku, anorm,
300 $ mode, cndnum, dist )
303 CALL zlatms( m, nrhs, dist, iseed,
TYPE, s, mode,
304 $ cndnum, anorm, kl, ku,
'No packing',
305 $ copyb, lda, work, info )
310 CALL alaerh( path,
'ZLATMS', info, 0,
' ', m,
311 $ nrhs, -1, -1, -1, 6, nfail, nerrs,
320 IF( .NOT.dotype( imat ) )
354 CALL zlaset(
'Full', m, n, czero, czero, copya, lda )
359 ELSE IF( (imat.GE.2 .AND. imat.LE.4 )
360 $ .OR. (imat.GE.14 .AND. imat.LE.19 ) )
THEN
367 CALL zlatb4( path, imat, m, n,
TYPE, kl, ku, anorm,
368 $ mode, cndnum, dist )
371 CALL zlatms( m, n, dist, iseed,
TYPE, s, mode,
372 $ cndnum, anorm, kl, ku,
'No packing',
373 $ copya, lda, work, info )
378 CALL alaerh( path,
'ZLATMS', info, 0,
' ', m, n,
379 $ -1, -1, -1, imat, nfail, nerrs,
384 CALL dlaord(
'Decreasing', minmn, s, 1 )
387 $ .AND. imat.GE.5 .AND. imat.LE.13 )
THEN
409 ELSE IF( imat.EQ.6 )
THEN
417 ELSE IF( imat.EQ.7 )
THEN
425 ELSE IF( imat.EQ.8 )
THEN
429 jb_zero = minmn / 2 + 1
433 ELSE IF( imat.EQ.9 )
THEN
441 ELSE IF( imat.EQ.10 )
THEN
446 jb_zero = minmn / 2 + 1
447 nb_zero = n - jb_zero + 1
450 ELSE IF( imat.EQ.11 )
THEN
456 jb_zero = minmn / 2 - (minmn / 2) / 2 + 1
460 ELSE IF( imat.EQ.12 )
THEN
469 ELSE IF( imat.EQ.13 )
THEN
484 CALL zlaset(
'Full', m, nb_zero, czero, czero,
491 CALL zlatb4( path, imat, m, nb_gen,
TYPE, kl, ku,
492 $ anorm, mode, cndnum, dist )
496 ind_offset_gen = nb_zero * lda
498 CALL zlatms( m, nb_gen, dist, iseed,
TYPE, s, mode,
499 $ cndnum, anorm, kl, ku,
'No packing',
500 $ copya( ind_offset_gen + 1 ), lda,
506 CALL alaerh( path,
'ZLATMS', info, 0,
' ', m,
507 $ nb_gen, -1, -1, -1, imat, nfail,
520 $ .OR. imat.EQ.11 )
THEN
527 DO j = 1, jb_zero-1, 1
529 $ copya( ( nb_zero+j-1)*lda+1), 1,
530 $ copya( (j-1)*lda + 1 ), 1 )
533 ELSE IF( imat.EQ.12 .OR. imat.EQ.13 )
THEN
546 ind_out = ( nb_zero+j-1 )*lda + 1
547 ind_in = ( j_inc*(j-1)+(j_first_nz-1) )*lda
550 $ copya( ind_out ), 1,
551 $ copya( ind_in), 1 )
561 minmnb_gen = min( m, nb_gen )
563 CALL dlaord(
'Decreasing', minmnb_gen, s, 1 )
565 DO i = minmnb_gen+1, minmn
595 DO kmax = 0, min(m,n)+1
605 CALL zlacpy(
'All', m, n, copya, lda, a, lda )
606 CALL zlacpy(
'All', m, nrhs, copyb, lda,
607 $ a( lda*n + 1 ), lda )
608 CALL zlacpy(
'All', m, nrhs, copyb, lda,
610 CALL icopy( n, iwork( 1 ), 1, iwork( n+1 ), 1 )
617 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
623 CALL zgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
624 $ a, lda, kfact, maxc2nrmk,
625 $ relmaxc2nrmk, iwork( n+1 ), tau,
626 $ work, lw, rwork, iwork( 2*n+1 ),
632 $
CALL alaerh( path,
'ZGEQP3RK', info, 0,
' ',
633 $ m, n, nx, -1, nb, imat,
634 $ nfail, nerrs, nout )
636 IF( kfact.EQ.minmn )
THEN
652 result( 1 ) = zqrt12( m, n, a, lda, s, work,
656 IF( result( t ).GE.thresh )
THEN
657 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
658 $
CALL alahd( nout, path )
659 WRITE( nout, fmt = 9999 )
'ZGEQP3RK', m, n,
660 $ nrhs, kmax, abstol, reltol, nb, nx,
661 $ imat, t, result( t )
677 result( 2 ) = zqpt01( m, n, kfact, copya, a, lda, tau,
678 $ iwork( n+1 ), work, lwork )
686 result( 3 ) = zqrt11( m, kfact, a, lda, tau, work,
693 IF( result( t ).GE.thresh )
THEN
694 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
695 $
CALL alahd( nout, path )
696 WRITE( nout, fmt = 9999 )
'ZGEQP3RK', m, n,
697 $ nrhs, kmax, abstol, reltol,
698 $ nb, nx, imat, t, result( t )
716 IF( min(kfact, minmn).GE.2 )
THEN
720 dtemp = (( abs( a( (j-1)*m+j ) ) -
721 $ abs( a( (j)*m+j+1 ) ) ) /
724 IF( dtemp.LT.zero )
THEN
734 IF( result( t ).GE.thresh )
THEN
735 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
736 $
CALL alahd( nout, path )
737 WRITE( nout, fmt = 9999 )
'ZGEQP3RK',
738 $ m, n, nrhs, kmax, abstol, reltol,
761 IF( minmn.GT.0 )
THEN
763 lwork_mqr = max(1, nrhs)
764 CALL zunmqr(
'Left',
'Conjugate transpose',
765 $ m, nrhs, kfact, a, lda, tau, b, lda,
766 $ work, lwork_mqr, info )
772 CALL zaxpy( m, -cone, a( ( n+i-1 )*lda+1 ), 1,
773 $ b( ( i-1 )*lda+1 ), 1 )
778 $ zlange(
'One-norm', m, nrhs, b, lda, rdummy ) /
779 $ ( dble( m )*dlamch(
'Epsilon' ) )
786 IF( result( t ).GE.thresh )
THEN
787 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
788 $
CALL alahd( nout, path )
789 WRITE( nout, fmt = 9999 )
'ZGEQP3RK', m, n,
790 $ nrhs, kmax, abstol, reltol,
791 $ nb, nx, imat, t, result( t )
827 CALL alasum( path, nout, nfail, nrun, nerrs )
829 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
830 $
', KMAX =', i5,
', ABSTOL =', g12.5,
831 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
832 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
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 dlaord(job, n, x, incx)
DLAORD
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
ZUNMQR
subroutine icopy(n, sx, incx, sy, incy)
ICOPY
subroutine zchkqp3rk(dotype, nm, mval, nn, nval, nns, nsval, nnb, nbval, nxval, thresh, a, copya, b, copyb, s, tau, work, rwork, iwork, nout)
ZCHKQP3RK
subroutine zgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, rwork, iwork, info)
ZGEQP3RK computes a truncated Householder QR factorization with column pivoting of a complex m-by-n m...
subroutine zlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
ZLATB4
subroutine zlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
ZLATMS