180 SUBROUTINE schkqp3rk( 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
196 INTEGER IWORK( * ), NBVAL( * ), MVAL( * ), NVAL( * ),
197 $ NSVAL( * ), NXVAL( * )
198 REAL A( * ), COPYA( * ), B( * ), COPYB( * ),
199 $ s( * ), tau( * ), work( * )
206 PARAMETER ( NTYPES = 19 )
208 parameter( ntests = 5 )
209 REAL ONE, ZERO, BIGNUM
210 parameter( one = 1.0e+0, zero = 0.0e+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 REAL ANORM, CNDNUM, EPS, ABSTOL, RELTOL,
225 $ DTEMP, MAXC2NRMK, RELMAXC2NRMK
228 INTEGER ISEED( 4 ), ISEEDY( 4 )
229 REAL RESULT( NTESTS ), RDUMMY( 1 )
232 REAL SLAMCH, SQPT01, SQRT11, SQRT12, SLANGE
233 EXTERNAL SLAMCH, SQPT01, SQRT11, SQRT12, SLANGE
241 INTRINSIC abs, max, min, mod, real
246 INTEGER INFOT, IOUNIT
249 COMMON / infoc / infot, iounit, ok, lerr
250 COMMON / srnamc / srnamt
253 DATA iseedy / 1988, 1989, 1990, 1991 /
259 path( 1: 1 ) =
'Single precision'
265 iseed( i ) = iseedy( i )
267 eps = slamch(
'Epsilon' )
283 lwork = max( 1, m*max( m, n )+4*minmn+max( m, n ),
284 $ m*n + 2*minmn + 4*n )
295 CALL slatb4( path, 14, m, nrhs,
TYPE, kl, ku, anorm,
296 $ mode, cndnum, dist )
299 CALL slatms( m, nrhs, dist, iseed,
TYPE, s, mode,
300 $ cndnum, anorm, kl, ku,
'No packing',
301 $ copyb, lda, work, info )
308 CALL alaerh( path,
'SLATMS', info, 0,
' ', m,
309 $ nrhs, -1, -1, -1, 6, nfail, nerrs,
318 IF( .NOT.dotype( imat ) )
352 CALL slaset(
'Full', m, n, zero, zero, copya, lda )
357 ELSE IF( (imat.GE.2 .AND. imat.LE.4 )
358 $ .OR. (imat.GE.14 .AND. imat.LE.19 ) )
THEN
365 CALL slatb4( path, imat, m, n,
TYPE, kl, ku, anorm,
366 $ mode, cndnum, dist )
369 CALL slatms( m, n, dist, iseed,
TYPE, s, mode,
370 $ cndnum, anorm, kl, ku,
'No packing',
371 $ copya, lda, work, info )
376 CALL alaerh( path,
'SLATMS', info, 0,
' ', m, n,
377 $ -1, -1, -1, imat, nfail, nerrs,
382 CALL slaord(
'Decreasing', minmn, s, 1 )
385 $ .AND. imat.GE.5 .AND. imat.LE.13 )
THEN
407 ELSE IF( imat.EQ.6 )
THEN
415 ELSE IF( imat.EQ.7 )
THEN
423 ELSE IF( imat.EQ.8 )
THEN
427 jb_zero = minmn / 2 + 1
431 ELSE IF( imat.EQ.9 )
THEN
439 ELSE IF( imat.EQ.10 )
THEN
444 jb_zero = minmn / 2 + 1
445 nb_zero = n - jb_zero + 1
448 ELSE IF( imat.EQ.11 )
THEN
454 jb_zero = minmn / 2 - (minmn / 2) / 2 + 1
458 ELSE IF( imat.EQ.12 )
THEN
467 ELSE IF( imat.EQ.13 )
THEN
482 CALL slaset(
'Full', m, nb_zero, zero, zero,
489 CALL slatb4( path, imat, m, nb_gen,
TYPE, kl, ku,
490 $ anorm, mode, cndnum, dist )
494 ind_offset_gen = nb_zero * lda
496 CALL slatms( m, nb_gen, dist, iseed,
TYPE, s, mode,
497 $ cndnum, anorm, kl, ku,
'No packing',
498 $ copya( ind_offset_gen + 1 ), lda,
504 CALL alaerh( path,
'SLATMS', info, 0,
' ', m,
505 $ nb_gen, -1, -1, -1, imat, nfail,
518 $ .OR. imat.EQ.11 )
THEN
525 DO j = 1, jb_zero-1, 1
527 $ copya( ( nb_zero+j-1)*lda+1), 1,
528 $ copya( (j-1)*lda + 1 ), 1 )
531 ELSE IF( imat.EQ.12 .OR. imat.EQ.13 )
THEN
544 ind_out = ( nb_zero+j-1 )*lda + 1
545 ind_in = ( j_inc*(j-1)+(j_first_nz-1) )*lda
548 $ copya( ind_out ), 1,
549 $ copya( ind_in), 1 )
559 minmnb_gen = min( m, nb_gen )
561 DO i = minmnb_gen+1, minmn
591 DO kmax = 0, min(m,n)+1
601 CALL slacpy(
'All', m, n, copya, lda, a, lda )
602 CALL slacpy(
'All', m, nrhs, copyb, lda,
603 $ a( lda*n + 1 ), lda )
604 CALL slacpy(
'All', m, nrhs, copyb, lda,
606 CALL icopy( n, iwork( 1 ), 1, iwork( n+1 ), 1 )
616 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
622 CALL sgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
623 $ a, lda, kfact, maxc2nrmk,
624 $ relmaxc2nrmk, iwork( n+1 ), tau,
625 $ work, lw, iwork( 2*n+1 ), info )
630 $
CALL alaerh( path,
'SGEQP3RK', info, 0,
' ',
631 $ m, n, nx, -1, nb, imat,
632 $ nfail, nerrs, nout )
648 IF( kfact.EQ.minmn )
THEN
650 result( 1 ) = sqrt12( m, n, a, lda, s, work,
665 result( 2 ) = sqpt01( m, n, kfact, copya, a, lda, tau,
666 $ iwork( n+1 ), work, lwork )
674 result( 3 ) = sqrt11( m, kfact, a, lda, tau, work,
691 IF( min(kfact, minmn).GE.2 )
THEN
695 dtemp = (( abs( a( (j-1)*lda+j ) ) -
696 $ abs( a( (j)*lda+j+1 ) ) ) /
699 IF( dtemp.LT.zero )
THEN
722 IF( minmn.GT.0 )
THEN
724 lwork_mqr = max(1, nrhs)
725 CALL sormqr(
'Left',
'Transpose',
726 $ m, nrhs, kfact, a, lda, tau, b, lda,
727 $ work, lwork_mqr, info )
733 CALL saxpy( m, -one, a( ( n+i-1 )*lda+1 ), 1,
734 $ b( ( i-1 )*lda+1 ), 1 )
738 $ slange(
'One-norm', m, nrhs, b, lda, rdummy ) /
739 $ ( real( m )*slamch(
'Epsilon' ) ) )
751 IF( result( t ).GE.thresh )
THEN
752 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
753 $
CALL alahd( nout, path )
754 WRITE( nout, fmt = 9999 )
'SGEQP3RK', m, n,
755 $ nrhs, kmax, abstol, reltol,
756 $ nb, nx, imat, t, result( t )
787 CALL alasum( path, nout, nfail, nrun, nerrs )
789 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
790 $
', KMAX =', i5,
', ABSTOL =', g12.5,
791 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
792 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )