588 SUBROUTINE zgeqp3rk( M, N, NRHS, KMAX, ABSTOL, RELTOL, A, LDA,
589 $ K, MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
590 $ WORK, LWORK, RWORK, IWORK, INFO )
598 INTEGER INFO, K, KF, KMAX, LDA, LWORK, M, N, NRHS
599 DOUBLE PRECISION ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
602 INTEGER IWORK( * ), JPIV( * )
603 DOUBLE PRECISION RWORK( * )
604 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
610 INTEGER INB, INBMIN, IXOVER
611 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
612 DOUBLE PRECISION ZERO, ONE, TWO
613 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
615 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
619 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
620 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
622 DOUBLE PRECISION EPS, HUGEVAL, MAXC2NRM, SAFMIN
629 INTEGER IDAMAX, ILAENV
630 DOUBLE PRECISION DLAMCH, DZNRM2
631 EXTERNAL disnan, dlamch, dznrm2, idamax, ilaenv
634 INTRINSIC dcmplx, max, min
642 lquery = ( lwork.EQ.-1 )
645 ELSE IF( n.LT.0 )
THEN
647 ELSE IF( nrhs.LT.0 )
THEN
649 ELSE IF( kmax.LT.0 )
THEN
651 ELSE IF( disnan( abstol ) )
THEN
653 ELSE IF( disnan( reltol ) )
THEN
655 ELSE IF( lda.LT.max( 1, m ) )
THEN
671 IF( minmn.EQ.0 )
THEN
687 nb = ilaenv( inb,
'ZGEQP3RK',
' ', m, n, -1, -1 )
704 lwkopt = 2*n + nb*( n+nrhs+1 )
706 work( 1 ) = dcmplx( lwkopt )
708 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
717 CALL xerbla(
'ZGEQP3RK', -info )
719 ELSE IF( lquery )
THEN
725 IF( minmn.EQ.0 )
THEN
729 work( 1 ) = dcmplx( lwkopt )
752 rwork( j ) = dznrm2( m, a( 1, j ), 1 )
753 rwork( n+j ) = rwork( j )
761 kp1 = idamax( n, rwork( 1 ), 1 )
765 IF( disnan( maxc2nrm ) )
THEN
777 relmaxc2nrmk = maxc2nrm
781 work( 1 ) = dcmplx( lwkopt )
787 IF( maxc2nrm.EQ.zero )
THEN
800 work( 1 ) = dcmplx( lwkopt )
807 hugeval = dlamch(
'Overflow' )
809 IF( maxc2nrm.GT.hugeval )
THEN
831 work( 1 ) = dcmplx( lwkopt )
837 eps = dlamch(
'Epsilon')
841 IF( abstol.GE.zero )
THEN
842 safmin = dlamch(
'Safe minimum')
843 abstol = max( abstol, two*safmin )
848 IF( reltol.GE.zero )
THEN
849 reltol = max( reltol, eps )
857 jmax = min( kmax, minmn )
866 IF( maxc2nrm.LE.abstol .OR. one.LE.reltol )
THEN
876 work( 1 ) = dcmplx( lwkopt )
889 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
894 nx = max( 0, ilaenv( ixover,
'ZGEQP3RK',
' ', m, n, -1, -1 ) )
896 IF( nx.LT.minmn )
THEN
900 IF( lwork.LT.lwkopt )
THEN
906 nb = ( lwork-2*n ) / ( n+1 )
907 nbmin = max( 2, ilaenv( inbmin,
'ZGEQP3RK',
' ', m, n,
932 jmaxb = min( kmax, minmn - nx )
934 IF( nb.GE.nbmin .AND. nb.LT.jmax .AND. jmaxb.GT.0 )
THEN
946 DO WHILE( j.LE.jmaxb )
948 jb = min( nb, jmaxb-j+1 )
954 CALL zlaqp3rk( m, n_sub, nrhs, ioffset, jb, abstol,
955 $ reltol, kp1, maxc2nrm, a( 1, j ), lda,
956 $ done, jbf, maxc2nrmk, relmaxc2nrmk,
957 $ jpiv( j ), tau( j ),
958 $ rwork( j ), rwork( n+j ),
959 $ work( 1 ), work( jb+1 ),
960 $ n+nrhs-j+1, iwork, iinfo )
964 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
965 info = 2*ioffset + iinfo
988 IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
989 info = ioffset + iinfo
994 work( 1 ) = dcmplx( lwkopt )
1012 IF( j.LE.jmax )
THEN
1020 CALL zlaqp2rk( m, n_sub, nrhs, ioffset, jmax-j+1,
1021 $ abstol, reltol, kp1, maxc2nrm, a( 1, j ), lda,
1022 $ kf, maxc2nrmk, relmaxc2nrmk, jpiv( j ),
1023 $ tau( j ), rwork( j ), rwork( n+j ),
1024 $ work( 1 ), iinfo )
1042 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
1043 info = 2*ioffset + iinfo
1044 ELSE IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
1045 info = ioffset + iinfo
1062 IF( k.LT.minmn )
THEN
1063 jmaxc2nrm = k + idamax( n-k, rwork( k+1 ), 1 )
1064 maxc2nrmk = rwork( jmaxc2nrm )
1068 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1085 work( 1 ) = dcmplx( lwkopt )
subroutine xerbla(srname, info)
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...