588 SUBROUTINE cgeqp3rk( 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 REAL ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
602 INTEGER IWORK( * ), JPIV( * )
604 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
610 INTEGER INB, INBMIN, IXOVER
611 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
613 parameter( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
615 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
619 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
620 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
622 REAL EPS, HUGEVAL, MAXC2NRM, SAFMIN
629 INTEGER ISAMAX, ILAENV
631 EXTERNAL sisnan, slamch, scnrm2, isamax, ilaenv
634 INTRINSIC cmplx, 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( sisnan( abstol ) )
THEN
653 ELSE IF( sisnan( reltol ) )
THEN
655 ELSE IF( lda.LT.max( 1, m ) )
THEN
671 IF( minmn.EQ.0 )
THEN
687 nb = ilaenv( inb,
'CGEQP3RK',
' ', m, n, -1, -1 )
704 lwkopt = 2*n + nb*( n+nrhs+1 )
706 work( 1 ) = cmplx( lwkopt )
708 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
717 CALL xerbla(
'CGEQP3RK', -info )
719 ELSE IF( lquery )
THEN
725 IF( minmn.EQ.0 )
THEN
729 work( 1 ) = cmplx( lwkopt )
752 rwork( j ) = scnrm2( m, a( 1, j ), 1 )
753 rwork( n+j ) = rwork( j )
761 kp1 = isamax( n, rwork( 1 ), 1 )
765 IF( sisnan( maxc2nrm ) )
THEN
777 relmaxc2nrmk = maxc2nrm
781 work( 1 ) = cmplx( lwkopt )
787 IF( maxc2nrm.EQ.zero )
THEN
800 work( 1 ) = cmplx( lwkopt )
807 hugeval = slamch(
'Overflow' )
809 IF( maxc2nrm.GT.hugeval )
THEN
831 work( 1 ) = cmplx( lwkopt )
837 eps = slamch(
'Epsilon')
841 IF( abstol.GE.zero )
THEN
842 safmin = slamch(
'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 ) = cmplx( lwkopt )
889 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
894 nx = max( 0, ilaenv( ixover,
'CGEQP3RK',
' ', 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,
'CGEQP3RK',
' ', 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 claqp3rk( 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 ) = cmplx( lwkopt )
1012 IF( j.LE.jmax )
THEN
1020 CALL claqp2rk( 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 + isamax( n-k, rwork( k+1 ), 1 )
1064 maxc2nrmk = rwork( jmaxc2nrm )
1068 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1085 work( 1 ) = cmplx( lwkopt )
subroutine xerbla(srname, info)
subroutine cgeqp3rk(m, n, nrhs, kmax, abstol, reltol, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, work, lwork, rwork, iwork, info)
CGEQP3RK computes a truncated Householder QR factorization with column pivoting of a complex m-by-n m...
subroutine claqp2rk(m, n, nrhs, ioffset, kmax, abstol, reltol, kp1, maxc2nrm, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, work, info)
CLAQP2RK computes truncated QR factorization with column pivoting of a complex matrix block using Lev...
subroutine claqp3rk(m, n, nrhs, ioffset, nb, abstol, reltol, kp1, maxc2nrm, a, lda, done, kb, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, auxv, f, ldf, iwork, info)
CLAQP3RK computes a step of truncated QR factorization with column pivoting of a complex m-by-n matri...