180 SUBROUTINE dchkqp3rk( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
181 $ NNB, NBVAL, NXVAL, THRESH, A, COPYA,
183 $ WORK, 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 A( * ), COPYA( * ), B( * ), COPYB( * ),
199 $ s( * ), tau( * ), work( * )
206 PARAMETER ( NTYPES = 19 )
208 parameter( ntests = 5 )
209 DOUBLE PRECISION ONE, ZERO, BIGNUM
210 parameter( one = 1.0d+0, zero = 0.0d+0,
216 INTEGER I, IHIGH, ILOW, IM, IMAT, IN, INC_ZERO,
217 $ inb, ind_offset_gen,
218 $ ind_in, ind_out, ins, info,
219 $ istep, j, j_inc, j_first_nz, jb_zero,
220 $ kfact, kl, kmax, ku, lda, lw, lwork,
221 $ lwork_mqr, m, minmn, minmnb_gen, mode, n,
222 $ nb, nb_zero, nerrs, nfail, nb_gen, nrhs,
224 DOUBLE PRECISION ANORM, CNDNUM, EPS, ABSTOL, RELTOL,
225 $ DTEMP, MAXC2NRMK, RELMAXC2NRMK
228 INTEGER ISEED( 4 ), ISEEDY( 4 )
229 DOUBLE PRECISION RESULT( NTESTS ), RDUMMY( 1 )
232 DOUBLE PRECISION DLAMCH, DQPT01, DQRT11, DQRT12, DLANGE,
234 EXTERNAL DLAMCH, DQPT01, DQRT11, DQRT12, DLANGE
242 INTRINSIC abs, dble, max, min, mod
247 INTEGER INFOT, IOUNIT
250 COMMON / infoc / infot, iounit, ok, lerr
251 COMMON / srnamc / srnamt
254 DATA iseedy / 1988, 1989, 1990, 1991 /
260 path( 1: 1 ) =
'Double precision'
266 iseed( i ) = iseedy( i )
268 eps = dlamch(
'Epsilon' )
284 lwork = max( 1, m*max( m, n )+4*minmn+max( m, n ),
285 $ m*n + 2*minmn + 4*n )
296 CALL dlatb4( path, 14, m, nrhs,
TYPE, kl, ku, anorm,
297 $ mode, cndnum, dist )
300 CALL dlatms( m, nrhs, dist, iseed,
TYPE, s, mode,
301 $ cndnum, anorm, kl, ku,
'No packing',
302 $ copyb, lda, work, info )
309 CALL alaerh( path,
'DLATMS', info, 0,
' ', m,
310 $ nrhs, -1, -1, -1, 6, nfail, nerrs,
319 IF( .NOT.dotype( imat ) )
353 CALL dlaset(
'Full', m, n, zero, zero, copya, lda )
358 ELSE IF( (imat.GE.2 .AND. imat.LE.4 )
359 $ .OR. (imat.GE.14 .AND. imat.LE.19 ) )
THEN
366 CALL dlatb4( path, imat, m, n,
TYPE, kl, ku, anorm,
367 $ mode, cndnum, dist )
370 CALL dlatms( m, n, dist, iseed,
TYPE, s, mode,
371 $ cndnum, anorm, kl, ku,
'No packing',
372 $ copya, lda, work, info )
377 CALL alaerh( path,
'DLATMS', info, 0,
' ', m, n,
378 $ -1, -1, -1, imat, nfail, nerrs,
383 CALL dlaord(
'Decreasing', minmn, s, 1 )
386 $ .AND. imat.GE.5 .AND. imat.LE.13 )
THEN
408 ELSE IF( imat.EQ.6 )
THEN
416 ELSE IF( imat.EQ.7 )
THEN
424 ELSE IF( imat.EQ.8 )
THEN
428 jb_zero = minmn / 2 + 1
432 ELSE IF( imat.EQ.9 )
THEN
440 ELSE IF( imat.EQ.10 )
THEN
445 jb_zero = minmn / 2 + 1
446 nb_zero = n - jb_zero + 1
449 ELSE IF( imat.EQ.11 )
THEN
455 jb_zero = minmn / 2 - (minmn / 2) / 2 + 1
459 ELSE IF( imat.EQ.12 )
THEN
468 ELSE IF( imat.EQ.13 )
THEN
483 CALL dlaset(
'Full', m, nb_zero, zero, zero,
490 CALL dlatb4( path, imat, m, nb_gen,
TYPE, kl, ku,
491 $ anorm, mode, cndnum, dist )
495 ind_offset_gen = nb_zero * lda
497 CALL dlatms( m, nb_gen, dist, iseed,
TYPE, s, mode,
498 $ cndnum, anorm, kl, ku,
'No packing',
499 $ copya( ind_offset_gen + 1 ), lda,
505 CALL alaerh( path,
'DLATMS', info, 0,
' ', m,
506 $ nb_gen, -1, -1, -1, imat, nfail,
519 $ .OR. imat.EQ.11 )
THEN
526 DO j = 1, jb_zero-1, 1
528 $ copya( ( nb_zero+j-1)*lda+1), 1,
529 $ copya( (j-1)*lda + 1 ), 1 )
532 ELSE IF( imat.EQ.12 .OR. imat.EQ.13 )
THEN
545 ind_out = ( nb_zero+j-1 )*lda + 1
546 ind_in = ( j_inc*(j-1)+(j_first_nz-1) )*lda
549 $ copya( ind_out ), 1,
550 $ copya( ind_in), 1 )
560 minmnb_gen = min( m, nb_gen )
562 DO i = minmnb_gen+1, minmn
592 DO kmax = 0, min(m,n)+1
602 CALL dlacpy(
'All', m, n, copya, lda, a, lda )
603 CALL dlacpy(
'All', m, nrhs, copyb, lda,
604 $ a( lda*n + 1 ), lda )
605 CALL dlacpy(
'All', m, nrhs, copyb, lda,
607 CALL icopy( n, iwork( 1 ), 1, iwork( n+1 ), 1 )
614 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
620 CALL dgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
621 $ a, lda, kfact, maxc2nrmk,
622 $ relmaxc2nrmk, iwork( n+1 ), tau,
623 $ work, lw, iwork( 2*n+1 ), info )
628 $
CALL alaerh( path,
'DGEQP3RK', info, 0,
' ',
629 $ m, n, nx, -1, nb, imat,
630 $ nfail, nerrs, nout )
646 IF( kfact.EQ.minmn )
THEN
648 result( 1 ) = dqrt12( m, n, a, lda, s, work,
652 IF( result( t ).GE.thresh )
THEN
653 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
654 $
CALL alahd( nout, path )
655 WRITE( nout, fmt = 9999 )
'DGEQP3RK', m, n,
656 $ nrhs, kmax, abstol, reltol, nb, nx,
657 $ imat, t, result( t )
673 result( 2 ) = dqpt01( m, n, kfact, copya, a, lda, tau,
674 $ iwork( n+1 ), work, lwork )
682 result( 3 ) = dqrt11( m, kfact, a, lda, tau, work,
689 IF( result( t ).GE.thresh )
THEN
690 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
691 $
CALL alahd( nout, path )
692 WRITE( nout, fmt = 9999 )
'DGEQP3RK', m, n,
693 $ nrhs, kmax, abstol, reltol,
694 $ nb, nx, imat, t, result( t )
712 IF( min(kfact, minmn).GE.2 )
THEN
716 dtemp = (( abs( a( (j-1)*m+j ) ) -
717 $ abs( a( (j)*m+j+1 ) ) ) /
720 IF( dtemp.LT.zero )
THEN
730 IF( result( t ).GE.thresh )
THEN
731 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
732 $
CALL alahd( nout, path )
733 WRITE( nout, fmt = 9999 )
'DGEQP3RK',
734 $ m, n, nrhs, kmax, abstol, reltol,
757 IF( minmn.GT.0 )
THEN
759 lwork_mqr = max(1, nrhs)
760 CALL dormqr(
'Left',
'Transpose',
761 $ m, nrhs, kfact, a, lda, tau, b, lda,
762 $ work, lwork_mqr, info )
768 CALL daxpy( m, -one, a( ( n+i-1 )*lda+1 ), 1,
769 $ b( ( i-1 )*lda+1 ), 1 )
774 $ dlange(
'One-norm', m, nrhs, b, lda, rdummy ) /
775 $ ( dble( m )*dlamch(
'Epsilon' ) )
782 IF( result( t ).GE.thresh )
THEN
783 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
784 $
CALL alahd( nout, path )
785 WRITE( nout, fmt = 9999 )
'DGEQP3RK', m, n,
786 $ nrhs, kmax, abstol, reltol,
787 $ nb, nx, imat, t, result( t )
823 CALL alasum( path, nout, nfail, nrun, nerrs )
825 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
826 $
', KMAX =', i5,
', ABSTOL =', g12.5,
827 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
828 $
', 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 dchkqp3rk(dotype, nm, mval, nn, nval, nns, nsval, nnb, nbval, nxval, thresh, a, copya, b, copyb, s, tau, work, iwork, nout)
DCHKQP3RK
subroutine dgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, iwork, info)
DGEQP3RK computes a truncated Householder QR factorization with column pivoting of a real m-by-n matr...
subroutine dlaord(job, n, x, incx)
DLAORD
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
subroutine dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
DORMQR
subroutine icopy(n, sx, incx, sy, incy)
ICOPY