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 )
613 lw = max( 1, max( 2*n + nb*( n+nrhs+1 ),
619 CALL sgeqp3rk( m, n, nrhs, kmax, abstol, reltol,
620 $ a, lda, kfact, maxc2nrmk,
621 $ relmaxc2nrmk, iwork( n+1 ), tau,
622 $ work, lw, iwork( 2*n+1 ), info )
627 $
CALL alaerh( path,
'SGEQP3RK', info, 0,
' ',
628 $ m, n, nx, -1, nb, imat,
629 $ nfail, nerrs, nout )
645 IF( kfact.EQ.minmn )
THEN
647 result( 1 ) = sqrt12( m, n, a, lda, s, work,
651 IF( result( t ).GE.thresh )
THEN
652 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
653 $
CALL alahd( nout, path )
654 WRITE( nout, fmt = 9999 )
'SGEQP3RK', m, n,
655 $ nrhs, kmax, abstol, reltol, nb, nx,
656 $ imat, t, result( t )
672 result( 2 ) = sqpt01( m, n, kfact, copya, a, lda, tau,
673 $ iwork( n+1 ), work, lwork )
681 result( 3 ) = sqrt11( m, kfact, a, lda, tau, work,
688 IF( result( t ).GE.thresh )
THEN
689 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
690 $
CALL alahd( nout, path )
691 WRITE( nout, fmt = 9999 )
'SGEQP3RK', m, n,
692 $ nrhs, kmax, abstol, reltol,
693 $ nb, nx, imat, t, result( t )
711 IF( min(kfact, minmn).GE.2 )
THEN
715 dtemp = (( abs( a( (j-1)*m+j ) ) -
716 $ abs( a( (j)*m+j+1 ) ) ) /
719 IF( dtemp.LT.zero )
THEN
729 IF( result( t ).GE.thresh )
THEN
730 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
731 $
CALL alahd( nout, path )
732 WRITE( nout, fmt = 9999 )
'SGEQP3RK',
733 $ m, n, nrhs, kmax, abstol, reltol,
756 IF( minmn.GT.0 )
THEN
758 lwork_mqr = max(1, nrhs)
759 CALL sormqr(
'Left',
'Transpose',
760 $ m, nrhs, kfact, a, lda, tau, b, lda,
761 $ work, lwork_mqr, info )
767 CALL saxpy( m, -one, a( ( n+i-1 )*lda+1 ), 1,
768 $ b( ( i-1 )*lda+1 ), 1 )
773 $ slange(
'One-norm', m, nrhs, b, lda, rdummy ) /
774 $ ( real( m )*slamch(
'Epsilon' ) )
781 IF( result( t ).GE.thresh )
THEN
782 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
783 $
CALL alahd( nout, path )
784 WRITE( nout, fmt = 9999 )
'SGEQP3RK', m, n,
785 $ nrhs, kmax, abstol, reltol,
786 $ nb, nx, imat, t, result( t )
822 CALL alasum( path, nout, nfail, nrun, nerrs )
824 9999
FORMAT( 1x, a,
' M =', i5,
', N =', i5,
', NRHS =', i5,
825 $
', KMAX =', i5,
', ABSTOL =', g12.5,
826 $
', RELTOL =', g12.5,
', NB =', i4,
', NX =', i4,
827 $
', 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 saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
subroutine sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
SORMQR
subroutine icopy(n, sx, incx, sy, incy)
ICOPY
subroutine schkqp3rk(dotype, nm, mval, nn, nval, nns, nsval, nnb, nbval, nxval, thresh, a, copya, b, copyb, s, tau, work, iwork, nout)
SCHKQP3RK
subroutine sgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, iwork, info)
SGEQP3RK computes a truncated Householder QR factorization with column pivoting of a real m-by-n matr...
subroutine slaord(job, n, x, incx)
SLAORD
subroutine slatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
SLATB4
subroutine slatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
SLATMS