392 SUBROUTINE zlaqp3rk( 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 DOUBLE PRECISION ABSTOL, MAXC2NRM, MAXC2NRMK, RELMAXC2NRMK,
410 INTEGER IWORK( * ), JPIV( * )
411 DOUBLE PRECISION VN1( * ), VN2( * )
412 COMPLEX*16 A( LDA, * ), AUXV( * ), F( LDF, * ), TAU( * )
418 DOUBLE PRECISION ZERO, ONE
419 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
420 COMPLEX*16 CZERO, CONE
421 parameter( czero = ( 0.0d+0, 0.0d+0 ),
422 $ cone = ( 1.0d+0, 0.0d+0 ) )
425 INTEGER ITEMP, J, K, MINMNFACT, MINMNUPDT,
427 DOUBLE PRECISION HUGEVAL, TAUNAN, TEMP, TEMP2, TOL3Z
434 INTRINSIC abs, dble, dconjg, dimag, max, min, sqrt
439 DOUBLE PRECISION DLAMCH, DZNRM2
440 EXTERNAL disnan, dlamch, idamax, dznrm2
451 minmnfact = min( m-ioffset, n )
452 minmnupdt = min( m-ioffset, n+nrhs )
453 nb = min( nb, minmnfact )
454 tol3z = sqrt( dlamch(
'Epsilon' ) )
455 hugeval = dlamch(
'Overflow' )
464 DO WHILE ( k.LT.nb .AND. lsticc.EQ.0 )
482 kp = ( k-1 ) + idamax( n-k+1, vn1( k ), 1 )
487 maxc2nrmk = vn1( kp )
499 IF( disnan( maxc2nrmk ) )
THEN
516 relmaxc2nrmk = maxc2nrmk
530 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
531 CALL zgemm(
'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 zgemm(
'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 zgemm(
'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 zswap( m, a( 1, kp ), 1, a( 1, k ), 1 )
700 CALL zswap( k-1, f( kp, 1 ), ldf, f( k, 1 ), ldf )
704 jpiv( kp ) = jpiv( k )
713 f( k, j ) = dconjg( f( k, j ) )
715 CALL zgemv(
'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 ) = dconjg( f( k, j ) )
725 CALL zlarfg( m-i+1, a( i, k ), a( i+1, k ), 1, tau( k ) )
740 IF( disnan( dble( tau(k) ) ) )
THEN
741 taunan = dble( tau(k) )
742 ELSE IF( disnan( dimag( tau(k) ) ) )
THEN
743 taunan = dimag( tau(k) )
748 IF( disnan( taunan ) )
THEN
766 relmaxc2nrmk = taunan
780 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
781 CALL zgemm(
'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 zgemv(
'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 zgemv(
'Conjugate Transpose', m-i+1, k-1, -tau( k ),
826 $ a( i, 1 ), lda, a( i, k ), 1, czero,
829 CALL zgemv(
'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 zgemm(
'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 zgemm(
'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 ) = dznrm2( m-
IF, a( if+1, lsticc ), 1 )
934 vn2( lsticc ) = vn1( lsticc )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
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...