582 SUBROUTINE dgeqp3rk( 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 DOUBLE PRECISION ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
596 INTEGER IWORK( * ), JPIV( * )
597 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
603 INTEGER INB, INBMIN, IXOVER
604 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
605 DOUBLE PRECISION ZERO, ONE, TWO
606 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
610 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
611 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
613 DOUBLE PRECISION EPS, HUGEVAL, MAXC2NRM, SAFMIN
620 INTEGER IDAMAX, ILAENV
621 DOUBLE PRECISION DLAMCH, DNRM2
622 EXTERNAL disnan, dlamch, dnrm2, idamax, ilaenv
625 INTRINSIC dble, 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( disnan( abstol ) )
THEN
644 ELSE IF( disnan( reltol ) )
THEN
646 ELSE IF( lda.LT.max( 1, m ) )
THEN
662 IF( minmn.EQ.0 )
THEN
680 nb = ilaenv( inb,
'DGEQP3RK',
' ', m, n, -1, -1 )
697 lwkopt = 2*n + nb*( n+nrhs+1 )
699 work( 1 ) = dble( lwkopt )
701 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
710 CALL xerbla(
'DGEQP3RK', -info )
712 ELSE IF( lquery )
THEN
718 IF( minmn.EQ.0 )
THEN
722 work( 1 ) = dble( lwkopt )
745 work( j ) = dnrm2( m, a( 1, j ), 1 )
746 work( n+j ) = work( j )
754 kp1 = idamax( n, work( 1 ), 1 )
755 maxc2nrm = work( kp1 )
759 IF( disnan( maxc2nrm ) )
THEN
771 relmaxc2nrmk = maxc2nrm
775 work( 1 ) = dble( lwkopt )
781 IF( maxc2nrm.EQ.zero )
THEN
794 work( 1 ) = dble( lwkopt )
801 hugeval = dlamch(
'Overflow' )
803 IF( maxc2nrm.GT.hugeval )
THEN
825 work( 1 ) = dble( lwkopt )
831 eps = dlamch(
'Epsilon')
835 IF( abstol.GE.zero )
THEN
836 safmin = dlamch(
'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 ) = dble( lwkopt )
883 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
888 nx = max( 0, ilaenv( ixover,
'DGEQP3RK',
' ', 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,
'DGEQP3RK',
' ', 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 dlaqp3rk( 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 ) = dble( lwkopt )
1006 IF( j.LE.jmax )
THEN
1014 CALL dlaqp2rk( 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 + idamax( n-k, work( k+1 ), 1 )
1058 maxc2nrmk = work( jmaxc2nrm )
1062 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1075 work( 1 ) = dble( lwkopt )
subroutine xerbla(srname, info)
subroutine dgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, iwork, info)
DGEQP3RK computes a truncated Householder QR factorization with column pivoting of a real m-by-n matr...
subroutine dlaqp2rk(m, n, nrhs, ioffset, kmax, abstol, reltol, kp1, maxc2nrm, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, work, info)
DLAQP2RK computes truncated QR factorization with column pivoting of a real matrix block using Level ...
subroutine dlaqp3rk(m, n, nrhs, ioffset, nb, abstol, reltol, kp1, maxc2nrm, a, lda, done, kb, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, auxv, f, ldf, iwork, info)
DLAQP3RK computes a step of truncated QR factorization with column pivoting of a real m-by-n matrix A...