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 )
617 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
623 CALL dgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
624 $ a, lda, kfact, maxc2nrmk,
625 $ relmaxc2nrmk, iwork( n+1 ), tau,
626 $ work, lw, iwork( 2*n+1 ), info )
631 $
CALL alaerh( path,
'DGEQP3RK', info, 0,
' ',
632 $ m, n, nx, -1, nb, imat,
633 $ nfail, nerrs, nout )
649 IF( kfact.EQ.minmn )
THEN
651 result( 1 ) = dqrt12( m, n, a, lda, s, work,
666 result( 2 ) = dqpt01( m, n, kfact, copya, a, lda, tau,
667 $ iwork( n+1 ), work, lwork )
675 result( 3 ) = dqrt11( m, kfact, a, lda, tau, work,
692 IF( min(kfact, minmn).GE.2 )
THEN
696 dtemp = (( abs( a( (j-1)*lda+j ) ) -
697 $ abs( a( (j)*lda+j+1 ) ) ) /
700 IF( dtemp.LT.zero )
THEN
723 IF( minmn.GT.0 )
THEN
725 lwork_mqr = max(1, nrhs)
726 CALL dormqr(
'Left',
'Transpose',
727 $ m, nrhs, kfact, a, lda, tau, b, lda,
728 $ work, lwork_mqr, info )
734 CALL daxpy( m, -one, a( ( n+i-1 )*lda+1 ), 1,
735 $ b( ( i-1 )*lda+1 ), 1 )
739 $ dlange(
'One-norm', m, nrhs, b, lda, rdummy ) /
740 $ ( dble( m )*dlamch(
'Epsilon' ) ) )
752 IF( result( t ).GE.thresh )
THEN
753 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
754 $
CALL alahd( nout, path )
755 WRITE( nout, fmt = 9999 )
'DGEQP3RK', m, n,
756 $ nrhs, kmax, abstol, reltol, nb, nx,
757 $ imat, t, result( t )
788 CALL alasum( path, nout, nfail, nrun, nerrs )
790 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
791 $
', KMAX =', i5,
', ABSTOL =', g12.5,
792 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
793 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )