579 SUBROUTINE cgeqp3rk( 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 REAL ABSTOL, MAXC2NRMK, RELMAXC2NRMK, RELTOL
593 INTEGER IWORK( * ), JPIV( * )
595 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
601 INTEGER INB, INBMIN, IXOVER
602 PARAMETER ( INB = 1, inbmin = 2, ixover = 3 )
604 parameter( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0 )
606 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
610 INTEGER IINFO, IOFFSET, IWS, J, JB, JBF, JMAXB, JMAX,
611 $ jmaxc2nrm, kp1, lwkopt, minmn, n_sub, nb,
613 REAL EPS, HUGEVAL, MAXC2NRM, SAFMIN
620 INTEGER ISAMAX, ILAENV
621 REAL SLAMCH, SCNRM2, SROUNDUP_LWORK
622 EXTERNAL sisnan, slamch, scnrm2, isamax, ilaenv,
626 INTRINSIC cmplx, max, min
634 lquery = ( lwork.EQ.-1 )
637 ELSE IF( n.LT.0 )
THEN
639 ELSE IF( nrhs.LT.0 )
THEN
641 ELSE IF( kmax.LT.0 )
THEN
643 ELSE IF( sisnan( abstol ) )
THEN
645 ELSE IF( sisnan( reltol ) )
THEN
647 ELSE IF( lda.LT.max( 1, m ) )
THEN
663 IF( minmn.EQ.0 )
THEN
679 nb = ilaenv( inb,
'CGEQP3RK',
' ', m, n, -1, -1 )
696 lwkopt = 2*n + nb*( n+nrhs+1 )
698 work( 1 ) = sroundup_lwork( lwkopt )
700 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
709 CALL xerbla(
'CGEQP3RK', -info )
711 ELSE IF( lquery )
THEN
717 IF( minmn.EQ.0 )
THEN
721 work( 1 ) = sroundup_lwork( lwkopt )
744 rwork( j ) = scnrm2( m, a( 1, j ), 1 )
745 rwork( n+j ) = rwork( j )
753 kp1 = isamax( n, rwork( 1 ), 1 )
757 IF( sisnan( maxc2nrm ) )
THEN
769 relmaxc2nrmk = maxc2nrm
773 work( 1 ) = sroundup_lwork( lwkopt )
779 IF( maxc2nrm.EQ.zero )
THEN
792 work( 1 ) = sroundup_lwork( lwkopt )
799 hugeval = slamch(
'Overflow' )
801 IF( maxc2nrm.GT.hugeval )
THEN
823 work( 1 ) = sroundup_lwork( lwkopt )
829 eps = slamch(
'Epsilon')
833 IF( abstol.GE.zero )
THEN
834 safmin = slamch(
'Safe minimum')
835 abstol = max( abstol, two*safmin )
840 IF( reltol.GE.zero )
THEN
841 reltol = max( reltol, eps )
849 jmax = min( kmax, minmn )
858 IF( maxc2nrm.LE.abstol .OR. one.LE.reltol )
THEN
868 work( 1 ) = sroundup_lwork( lwkopt )
881 IF( ( nb.GT.1 ) .AND. ( nb.LT.minmn ) )
THEN
886 nx = max( 0, ilaenv( ixover,
'CGEQP3RK',
' ', m, n, -1,
889 IF( nx.LT.minmn )
THEN
893 IF( lwork.LT.lwkopt )
THEN
899 nb = ( lwork-2*n ) / ( n+1 )
900 nbmin = max( 2, ilaenv( inbmin,
'CGEQP3RK',
' ', m, n,
925 jmaxb = min( kmax, minmn - nx )
927 IF( nb.GE.nbmin .AND. nb.LT.jmax .AND. jmaxb.GT.0 )
THEN
939 DO WHILE( j.LE.jmaxb )
941 jb = min( nb, jmaxb-j+1 )
947 CALL claqp3rk( m, n_sub, nrhs, ioffset, jb, abstol,
948 $ reltol, kp1, maxc2nrm, a( 1, j ), lda,
949 $ done, jbf, maxc2nrmk, relmaxc2nrmk,
950 $ jpiv( j ), tau( j ),
951 $ rwork( j ), rwork( n+j ),
952 $ work( 1 ), work( jb+1 ),
953 $ n+nrhs-j+1, iwork, iinfo )
957 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
958 info = 2*ioffset + iinfo
981 IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
982 info = ioffset + iinfo
987 work( 1 ) = sroundup_lwork( lwkopt )
1005 IF( j.LE.jmax )
THEN
1013 CALL claqp2rk( m, n_sub, nrhs, ioffset, jmax-j+1,
1014 $ abstol, reltol, kp1, maxc2nrm, a( 1, j ), lda,
1015 $ kf, maxc2nrmk, relmaxc2nrmk, jpiv( j ),
1016 $ tau( j ), rwork( j ), rwork( n+j ),
1017 $ work( 1 ), iinfo )
1035 IF( iinfo.GT.n_sub .AND. info.EQ.0 )
THEN
1036 info = 2*ioffset + iinfo
1037 ELSE IF( iinfo.LE.n_sub .AND. iinfo.GT.0 )
THEN
1038 info = ioffset + iinfo
1055 IF( k.LT.minmn )
THEN
1056 jmaxc2nrm = k + isamax( n-k, rwork( k+1 ), 1 )
1057 maxc2nrmk = rwork( jmaxc2nrm )
1061 relmaxc2nrmk = maxc2nrmk / maxc2nrm
1078 work( 1 ) = sroundup_lwork( lwkopt )
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...