582 SUBROUTINE sgeqp3rk( M, N, NRHS, KMAX, ABSTOL, RELTOL, A, LDA,
583 $ K, MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
584 $ WORK, LWORK, IWORK, INFO )
592 INTEGER INFO, K, KF, KMAX, LDA, LWORK, M, N, NRHS
593 REAL ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
596 INTEGER IWORK( * ), JPIV( * )
597 REAL A( LDA, * ), TAU( * ), WORK( * )
603 INTEGER INB, INBMIN, IXOVER
604 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
606 parameter( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
610 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
611 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
613 REAL EPS, HUGEVAL, MAXC2NRM, SAFMIN
620 INTEGER ISAMAX, ILAENV
622 EXTERNAL sisnan, slamch, snrm2, isamax, ilaenv
625 INTRINSIC real, max, min
633 lquery = ( lwork.EQ.-1 )
636 ELSE IF( n.LT.0 )
THEN
638 ELSE IF( nrhs.LT.0 )
THEN
640 ELSE IF( kmax.LT.0 )
THEN
642 ELSE IF( sisnan( abstol ) )
THEN
644 ELSE IF( sisnan( reltol ) )
THEN
646 ELSE IF( lda.LT.max( 1, m ) )
THEN
662 IF( minmn.EQ.0 )
THEN
680 nb = ilaenv( inb,
'SGEQP3RK',
' ', m, n, -1, -1 )
697 lwkopt = 2*n + nb*( n+nrhs+1 )
699 work( 1 ) = real( lwkopt )
701 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
710 CALL xerbla(
'SGEQP3RK', -info )
712 ELSE IF( lquery )
THEN
718 IF( minmn.EQ.0 )
THEN
722 work( 1 ) = real( lwkopt )
745 work( j ) = snrm2( m, a( 1, j ), 1 )
746 work( n+j ) = work( j )
754 kp1 = isamax( n, work( 1 ), 1 )
755 maxc2nrm = work( kp1 )
759 IF( sisnan( maxc2nrm ) )
THEN
771 relmaxc2nrmk = maxc2nrm
775 work( 1 ) = real( lwkopt )
781 IF( maxc2nrm.EQ.zero )
THEN
794 work( 1 ) = real( lwkopt )
801 hugeval = slamch(
'Overflow' )
803 IF( maxc2nrm.GT.hugeval )
THEN
825 work( 1 ) = real( lwkopt )
831 eps = slamch(
'Epsilon')
835 IF( abstol.GE.zero )
THEN
836 safmin = slamch(
'Safe minimum')
837 abstol = max( abstol, two*safmin )
842 IF( reltol.GE.zero )
THEN
843 reltol = max( reltol, eps )
851 jmax = min( kmax, minmn )
860 IF( maxc2nrm.LE.abstol .OR. one.LE.reltol )
THEN
870 work( 1 ) = real( lwkopt )
883 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
888 nx = max( 0, ilaenv( ixover,
'SGEQP3RK',
' ', m, n, -1, -1 ))
890 IF( nx.LT.minmn )
THEN
894 IF( lwork.LT.lwkopt )
THEN
900 nb = ( lwork-2*n ) / ( n+1 )
901 nbmin = max( 2, ilaenv( inbmin,
'SGEQP3RK',
' ', m, n,
926 jmaxb = min( kmax, minmn - nx )
928 IF( nb.GE.nbmin .AND. nb.LT.jmax .AND. jmaxb.GT.0 )
THEN
940 DO WHILE( j.LE.jmaxb )
942 jb = min( nb, jmaxb-j+1 )
948 CALL slaqp3rk( m, n_sub, nrhs, ioffset, jb, abstol,
949 $ reltol, kp1, maxc2nrm, a( 1, j ), lda,
950 $ done, jbf, maxc2nrmk, relmaxc2nrmk,
951 $ jpiv( j ), tau( j ),
952 $ work( j ), work( n+j ),
953 $ work( 2*n+1 ), work( 2*n+jb+1 ),
954 $ n+nrhs-j+1, iwork, iinfo )
958 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
959 info = 2*ioffset + iinfo
982 IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
983 info = ioffset + iinfo
988 work( 1 ) = real( lwkopt )
1006 IF( j.LE.jmax )
THEN
1014 CALL slaqp2rk( m, n_sub, nrhs, ioffset, jmax-j+1,
1015 $ abstol, reltol, kp1, maxc2nrm, a( 1, j ), lda,
1016 $ kf, maxc2nrmk, relmaxc2nrmk, jpiv( j ),
1017 $ tau( j ), work( j ), work( n+j ),
1018 $ work( 2*n+1 ), iinfo )
1036 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
1037 info = 2*ioffset + iinfo
1038 ELSE IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
1039 info = ioffset + iinfo
1056 IF( k.LT.minmn )
THEN
1057 jmaxc2nrm = k + isamax( n-k, work( k+1 ), 1 )
1058 maxc2nrmk = work( jmaxc2nrm )
1062 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1075 work( 1 ) = real( lwkopt )
subroutine xerbla(srname, info)
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 slaqp2rk(m, n, nrhs, ioffset, kmax, abstol, reltol, kp1, maxc2nrm, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, work, info)
SLAQP2RK computes truncated QR factorization with column pivoting of a real matrix block using Level ...
subroutine slaqp3rk(m, n, nrhs, ioffset, nb, abstol, reltol, kp1, maxc2nrm, a, lda, done, kb, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, auxv, f, ldf, iwork, info)
SLAQP3RK computes a step of truncated QR factorization with column pivoting of a real m-by-n matrix A...