579 SUBROUTINE zgeqp3rk( M, N, NRHS, KMAX, ABSTOL, RELTOL, A, LDA,
580 $ K, MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
581 $ WORK, LWORK, RWORK, IWORK, INFO )
589 INTEGER INFO, K, KF, KMAX, LDA, LWORK, M, N, NRHS
590 DOUBLE PRECISION ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
593 INTEGER IWORK( * ), JPIV( * )
594 DOUBLE PRECISION RWORK( * )
595 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
601 INTEGER INB, INBMIN, IXOVER
602 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
603 DOUBLE PRECISION ZERO, ONE, TWO
604 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
606 parameter( czero = ( 0.0d+0, 0.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, DZNRM2
622 EXTERNAL disnan, dlamch, dznrm2, idamax, ilaenv
625 INTRINSIC dcmplx, 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
678 nb = ilaenv( inb,
'ZGEQP3RK',
' ', m, n, -1, -1 )
695 lwkopt = 2*n + nb*( n+nrhs+1 )
697 work( 1 ) = dcmplx( lwkopt )
699 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
708 CALL xerbla(
'ZGEQP3RK', -info )
710 ELSE IF( lquery )
THEN
716 IF( minmn.EQ.0 )
THEN
720 work( 1 ) = dcmplx( lwkopt )
743 rwork( j ) = dznrm2( m, a( 1, j ), 1 )
744 rwork( n+j ) = rwork( j )
752 kp1 = idamax( n, rwork( 1 ), 1 )
756 IF( disnan( maxc2nrm ) )
THEN
768 relmaxc2nrmk = maxc2nrm
772 work( 1 ) = dcmplx( lwkopt )
778 IF( maxc2nrm.EQ.zero )
THEN
791 work( 1 ) = dcmplx( lwkopt )
798 hugeval = dlamch(
'Overflow' )
800 IF( maxc2nrm.GT.hugeval )
THEN
822 work( 1 ) = dcmplx( lwkopt )
828 eps = dlamch(
'Epsilon')
832 IF( abstol.GE.zero )
THEN
833 safmin = dlamch(
'Safe minimum')
834 abstol = max( abstol, two*safmin )
839 IF( reltol.GE.zero )
THEN
840 reltol = max( reltol, eps )
848 jmax = min( kmax, minmn )
857 IF( maxc2nrm.LE.abstol .OR. one.LE.reltol )
THEN
867 work( 1 ) = dcmplx( lwkopt )
880 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
885 nx = max( 0, ilaenv( ixover,
'ZGEQP3RK',
' ', m, n, -1,
888 IF( nx.LT.minmn )
THEN
892 IF( lwork.LT.lwkopt )
THEN
898 nb = ( lwork-2*n ) / ( n+1 )
899 nbmin = max( 2, ilaenv( inbmin,
'ZGEQP3RK',
' ', m, n,
924 jmaxb = min( kmax, minmn - nx )
926 IF( nb.GE.nbmin .AND. nb.LT.jmax .AND. jmaxb.GT.0 )
THEN
938 DO WHILE( j.LE.jmaxb )
940 jb = min( nb, jmaxb-j+1 )
946 CALL zlaqp3rk( m, n_sub, nrhs, ioffset, jb, abstol,
947 $ reltol, kp1, maxc2nrm, a( 1, j ), lda,
948 $ done, jbf, maxc2nrmk, relmaxc2nrmk,
949 $ jpiv( j ), tau( j ),
950 $ rwork( j ), rwork( n+j ),
951 $ work( 1 ), work( jb+1 ),
952 $ n+nrhs-j+1, iwork, iinfo )
956 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
957 info = 2*ioffset + iinfo
980 IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
981 info = ioffset + iinfo
986 work( 1 ) = dcmplx( lwkopt )
1004 IF( j.LE.jmax )
THEN
1012 CALL zlaqp2rk( m, n_sub, nrhs, ioffset, jmax-j+1,
1013 $ abstol, reltol, kp1, maxc2nrm, a( 1, j ), lda,
1014 $ kf, maxc2nrmk, relmaxc2nrmk, jpiv( j ),
1015 $ tau( j ), rwork( j ), rwork( n+j ),
1016 $ work( 1 ), iinfo )
1034 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
1035 info = 2*ioffset + iinfo
1036 ELSE IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
1037 info = ioffset + iinfo
1054 IF( k.LT.minmn )
THEN
1055 jmaxc2nrm = k + idamax( n-k, rwork( k+1 ), 1 )
1056 maxc2nrmk = rwork( jmaxc2nrm )
1060 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1077 work( 1 ) = dcmplx( lwkopt )
subroutine zgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, rwork, iwork, info)
ZGEQP3RK computes a truncated Householder QR factorization with column pivoting of a complex m-by-n m...
subroutine zlaqp2rk(m, n, nrhs, ioffset, kmax, abstol, reltol, kp1, maxc2nrm, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, work, info)
ZLAQP2RK computes truncated QR factorization with column pivoting of a complex matrix block using Lev...
subroutine zlaqp3rk(m, n, nrhs, ioffset, nb, abstol, reltol, kp1, maxc2nrm, a, lda, done, kb, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, auxv, f, ldf, iwork, info)
ZLAQP3RK computes a step of truncated QR factorization with column pivoting of a complex m-by-n matri...