392 SUBROUTINE claqp3rk( M, N, NRHS, IOFFSET, NB, ABSTOL,
393 $ RELTOL, KP1, MAXC2NRM, A, LDA, DONE, KB,
394 $ MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
395 $ VN1, VN2, AUXV, F, LDF, IWORK, INFO )
404 INTEGER INFO, IOFFSET, KB, KP1, LDA, LDF, M, N,
406 REAL ABSTOL, MAXC2NRM, MAXC2NRMK, RELMAXC2NRMK,
410 INTEGER IWORK( * ), JPIV( * )
411 REAL VN1( * ), VN2( * )
412 COMPLEX A( LDA, * ), AUXV( * ), F( LDF, * ), TAU( * )
419 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
421 parameter( czero = ( 0.0e+0, 0.0e+0 ),
422 $ cone = ( 1.0e+0, 0.0e+0 ) )
425 INTEGER ITEMP, J, K, MINMNFACT, MINMNUPDT,
427 REAL HUGEVAL, TAUNAN, TEMP, TEMP2, TOL3Z
434 INTRINSIC abs, real, conjg, imag, max, min, sqrt
440 EXTERNAL sisnan, slamch, isamax, scnrm2
451 minmnfact = min( m-ioffset, n )
452 minmnupdt = min( m-ioffset, n+nrhs )
453 nb = min( nb, minmnfact )
454 tol3z = sqrt( slamch(
'Epsilon' ) )
455 hugeval = slamch(
'Overflow' )
464 DO WHILE ( k.LT.nb .AND. lsticc.EQ.0 )
482 kp = ( k-1 ) + isamax( n-k+1, vn1( k ), 1 )
487 maxc2nrmk = vn1( kp )
499 IF( sisnan( maxc2nrmk ) )
THEN
516 relmaxc2nrmk = maxc2nrmk
530 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
531 CALL cgemm(
'No transpose',
'Conjugate transpose',
532 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
533 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
553 IF( maxc2nrmk.EQ.zero )
THEN
579 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
580 CALL cgemm(
'No transpose',
'Conjugate transpose',
581 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
582 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
613 IF( info.EQ.0 .AND. maxc2nrmk.GT.hugeval )
THEN
614 info = n + k - 1 + kp
629 relmaxc2nrmk = maxc2nrmk / maxc2nrm
631 IF( maxc2nrmk.LE.abstol .OR. relmaxc2nrmk.LE.reltol )
THEN
655 IF( kb.LT.minmnupdt )
THEN
656 CALL cgemm(
'No transpose',
'Conjugate transpose',
657 $ m-
IF, n+nrhs-kb, kb,-cone, a( if+1, 1 ), lda,
658 $ f( kb+1, 1 ), ldf, cone, a( if+1, kb+1 ), lda )
699 CALL cswap( m, a( 1, kp ), 1, a( 1, k ), 1 )
700 CALL cswap( k-1, f( kp, 1 ), ldf, f( k, 1 ), ldf )
704 jpiv( kp ) = jpiv( k )
713 f( k, j ) = conjg( f( k, j ) )
715 CALL cgemv(
'No transpose', m-i+1, k-1, -cone, a( i, 1 ),
716 $ lda, f( k, 1 ), ldf, cone, a( i, k ), 1 )
718 f( k, j ) = conjg( f( k, j ) )
725 CALL clarfg( m-i+1, a( i, k ), a( i+1, k ), 1, tau( k ) )
740 IF( sisnan( real( tau(k) ) ) )
THEN
741 taunan = real( tau(k) )
742 ELSE IF( sisnan( imag( tau(k) ) ) )
THEN
743 taunan = imag( tau(k) )
748 IF( sisnan( taunan ) )
THEN
766 relmaxc2nrmk = taunan
780 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
781 CALL cgemm(
'No transpose',
'Conjugate transpose',
782 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
783 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
807 IF( k.LT.n+nrhs )
THEN
808 CALL cgemv(
'Conjugate transpose', m-i+1, n+nrhs-k,
809 $ tau( k ), a( i, k+1 ), lda, a( i, k ), 1,
810 $ czero, f( k+1, k ), 1 )
825 CALL cgemv(
'Conjugate Transpose', m-i+1, k-1, -tau( k ),
826 $ a( i, 1 ), lda, a( i, k ), 1, czero,
829 CALL cgemv(
'No transpose', n+nrhs, k-1, cone,
830 $ f( 1, 1 ), ldf, auxv( 1 ), 1, cone,
840 IF( k.LT.n+nrhs )
THEN
841 CALL cgemm(
'No transpose',
'Conjugate transpose',
842 $ 1, n+nrhs-k, k, -cone, a( i, 1 ), lda,
843 $ f( k+1, 1 ), ldf, cone, a( i, k+1 ), lda )
852 IF( k.LT.minmnfact )
THEN
855 IF( vn1( j ).NE.zero )
THEN
860 temp = abs( a( i, j ) ) / vn1( j )
861 temp = max( zero, ( one+temp )*( one-temp ) )
862 temp2 = temp*( vn1( j ) / vn2( j ) )**2
863 IF( temp2.LE.tol3z )
THEN
872 iwork( j-1 ) = lsticc
879 vn1( j ) = vn1( j )*sqrt( temp )
908 IF( kb.LT.minmnupdt )
THEN
909 CALL cgemm(
'No transpose',
'Conjugate transpose',
910 $ m-
IF, n+nrhs-kb, kb, -cone, a( if+1, 1 ), lda,
911 $ f( kb+1, 1 ), ldf, cone, a( if+1, kb+1 ), lda )
918 DO WHILE( lsticc.GT.0 )
924 itemp = iwork( lsticc-1 )
933 vn1( lsticc ) = scnrm2( m-
IF, a( if+1, lsticc ), 1 )
934 vn2( lsticc ) = vn1( lsticc )
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...
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
subroutine cswap(n, cx, incx, cy, incy)
CSWAP