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 )
620 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
626 CALL zgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
627 $ a, lda, kfact, maxc2nrmk,
628 $ relmaxc2nrmk, iwork( n+1 ), tau,
629 $ work, lw, rwork, iwork( 2*n+1 ),
635 $
CALL alaerh( path,
'ZGEQP3RK', info, 0,
' ',
636 $ m, n, nx, -1, nb, imat,
637 $ nfail, nerrs, nout )
639 IF( kfact.EQ.minmn )
THEN
655 result( 1 ) = zqrt12( m, n, a, lda, s, work,
670 result( 2 ) = zqpt01( m, n, kfact, copya, a, lda, tau,
671 $ iwork( n+1 ), work, lwork )
679 result( 3 ) = zqrt11( m, kfact, a, lda, tau, work,
696 IF( min(kfact, minmn).GE.2 )
THEN
700 dtemp = (( abs( a( (j-1)*lda+j ) ) -
701 $ abs( a( (j)*lda+j+1 ) ) ) /
704 IF( dtemp.LT.zero )
THEN
727 IF( minmn.GT.0 )
THEN
729 lwork_mqr = max(1, nrhs)
730 CALL zunmqr(
'Left',
'Conjugate transpose',
731 $ m, nrhs, kfact, a, lda, tau, b, lda,
732 $ work, lwork_mqr, info )
738 CALL zaxpy( m, -cone, a( ( n+i-1 )*lda+1 ), 1,
739 $ b( ( i-1 )*lda+1 ), 1 )
743 $ zlange(
'One-norm', m, nrhs, b, lda, rdummy ) /
744 $ ( dble( m )*dlamch(
'Epsilon' ) ) )
756 IF( result( t ).GE.thresh )
THEN
757 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
758 $
CALL alahd( nout, path )
759 WRITE( nout, fmt = 9999 )
'ZGEQP3RK', m, n,
760 $ nrhs, kmax, abstol, reltol,
761 $ nb, nx, imat, t, result( t )
792 CALL alasum( path, nout, nfail, nrun, nerrs )
794 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
795 $
', KMAX =', i5,
', ABSTOL =', g12.5,
796 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
797 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )