573 SUBROUTINE dgeqp3rk( M, N, NRHS, KMAX, ABSTOL, RELTOL, A, LDA,
574 $ K, MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
575 $ WORK, LWORK, IWORK, INFO )
583 INTEGER INFO, K, KF, KMAX, LDA, LWORK, M, N, NRHS
584 DOUBLE PRECISION ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
587 INTEGER IWORK( * ), JPIV( * )
588 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
594 INTEGER INB, INBMIN, IXOVER
595 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
596 DOUBLE PRECISION ZERO, ONE, TWO
597 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
601 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
602 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
604 DOUBLE PRECISION EPS, HUGEVAL, MAXC2NRM, SAFMIN
611 INTEGER IDAMAX, ILAENV
612 DOUBLE PRECISION DLAMCH, DNRM2
613 EXTERNAL disnan, dlamch, dnrm2, idamax, ilaenv
616 INTRINSIC dble, max, min
624 lquery = ( lwork.EQ.-1 )
627 ELSE IF( n.LT.0 )
THEN
629 ELSE IF( nrhs.LT.0 )
THEN
631 ELSE IF( kmax.LT.0 )
THEN
633 ELSE IF( disnan( abstol ) )
THEN
635 ELSE IF( disnan( reltol ) )
THEN
637 ELSE IF( lda.LT.max( 1, m ) )
THEN
653 IF( minmn.EQ.0 )
THEN
671 nb = ilaenv( inb,
'DGEQP3RK',
' ', m, n, -1, -1 )
688 lwkopt = 2*n + nb*( n+nrhs+1 )
690 work( 1 ) = dble( lwkopt )
692 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
701 CALL xerbla(
'DGEQP3RK', -info )
703 ELSE IF( lquery )
THEN
709 IF( minmn.EQ.0 )
THEN
713 work( 1 ) = dble( lwkopt )
736 work( j ) = dnrm2( m, a( 1, j ), 1 )
737 work( n+j ) = work( j )
745 kp1 = idamax( n, work( 1 ), 1 )
746 maxc2nrm = work( kp1 )
750 IF( disnan( maxc2nrm ) )
THEN
762 relmaxc2nrmk = maxc2nrm
766 work( 1 ) = dble( lwkopt )
772 IF( maxc2nrm.EQ.zero )
THEN
785 work( 1 ) = dble( lwkopt )
792 hugeval = dlamch(
'Overflow' )
794 IF( maxc2nrm.GT.hugeval )
THEN
816 work( 1 ) = dble( lwkopt )
822 eps = dlamch(
'Epsilon')
826 IF( abstol.GE.zero )
THEN
827 safmin = dlamch(
'Safe minimum')
828 abstol = max( abstol, two*safmin )
833 IF( reltol.GE.zero )
THEN
834 reltol = max( reltol, eps )
842 jmax = min( kmax, minmn )
851 IF( maxc2nrm.LE.abstol .OR. one.LE.reltol )
THEN
861 work( 1 ) = dble( lwkopt )
874 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
879 nx = max( 0, ilaenv( ixover,
'DGEQP3RK',
' ', m, n, -1,
882 IF( nx.LT.minmn )
THEN
886 IF( lwork.LT.lwkopt )
THEN
892 nb = ( lwork-2*n ) / ( n+1 )
893 nbmin = max( 2, ilaenv( inbmin,
'DGEQP3RK',
' ', m, n,
918 jmaxb = min( kmax, minmn - nx )
920 IF( nb.GE.nbmin .AND. nb.LT.jmax .AND. jmaxb.GT.0 )
THEN
932 DO WHILE( j.LE.jmaxb )
934 jb = min( nb, jmaxb-j+1 )
940 CALL dlaqp3rk( m, n_sub, nrhs, ioffset, jb, abstol,
941 $ reltol, kp1, maxc2nrm, a( 1, j ), lda,
942 $ done, jbf, maxc2nrmk, relmaxc2nrmk,
943 $ jpiv( j ), tau( j ),
944 $ work( j ), work( n+j ),
945 $ work( 2*n+1 ), work( 2*n+jb+1 ),
946 $ n+nrhs-j+1, iwork, iinfo )
950 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
951 info = 2*ioffset + iinfo
974 IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
975 info = ioffset + iinfo
980 work( 1 ) = dble( lwkopt )
1006 CALL dlaqp2rk( m, n_sub, nrhs, ioffset, jmax-j+1,
1007 $ abstol, reltol, kp1, maxc2nrm, a( 1, j ), lda,
1008 $ kf, maxc2nrmk, relmaxc2nrmk, jpiv( j ),
1009 $ tau( j ), work( j ), work( n+j ),
1010 $ work( 2*n+1 ), iinfo )
1028 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
1029 info = 2*ioffset + iinfo
1030 ELSE IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
1031 info = ioffset + iinfo
1048 IF( k.LT.minmn )
THEN
1049 jmaxc2nrm = k + idamax( n-k, work( k+1 ), 1 )
1050 maxc2nrmk = work( jmaxc2nrm )
1054 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1067 work( 1 ) = dble( lwkopt )
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...