382 SUBROUTINE claqp3rk( M, N, NRHS, IOFFSET, NB, ABSTOL,
383 $ RELTOL, KP1, MAXC2NRM, A, LDA, DONE, KB,
384 $ MAXC2NRMK, RELMAXC2NRMK, JPIV, TAU,
385 $ VN1, VN2, AUXV, F, LDF, IWORK, INFO )
394 INTEGER INFO, IOFFSET, KB, KP1, LDA, LDF, M, N,
396 REAL ABSTOL, MAXC2NRM, MAXC2NRMK, RELMAXC2NRMK,
400 INTEGER IWORK( * ), JPIV( * )
401 REAL VN1( * ), VN2( * )
402 COMPLEX A( LDA, * ), AUXV( * ), F( LDF, * ), TAU( * )
409 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
411 parameter( czero = ( 0.0e+0, 0.0e+0 ),
412 $ cone = ( 1.0e+0, 0.0e+0 ) )
415 INTEGER ITEMP, J, K, MINMNFACT, MINMNUPDT,
417 REAL HUGEVAL, TAUNAN, TEMP, TEMP2, TOL3Z
424 INTRINSIC abs, real, conjg, aimag, max, min, sqrt
430 EXTERNAL sisnan, slamch, isamax, scnrm2
441 minmnfact = min( m-ioffset, n )
442 minmnupdt = min( m-ioffset, n+nrhs )
443 nb = min( nb, minmnfact )
444 tol3z = sqrt( slamch(
'Epsilon' ) )
445 hugeval = slamch(
'Overflow' )
454 DO WHILE ( k.LT.nb .AND. lsticc.EQ.0 )
472 kp = ( k-1 ) + isamax( n-k+1, vn1( k ), 1 )
477 maxc2nrmk = vn1( kp )
489 IF( sisnan( maxc2nrmk ) )
THEN
506 relmaxc2nrmk = maxc2nrmk
520 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
521 CALL cgemm(
'No transpose',
'Conjugate transpose',
522 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
523 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
543 IF( maxc2nrmk.EQ.zero )
THEN
569 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
570 CALL cgemm(
'No transpose',
'Conjugate transpose',
571 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
572 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
603 IF( info.EQ.0 .AND. maxc2nrmk.GT.hugeval )
THEN
604 info = n + k - 1 + kp
619 relmaxc2nrmk = maxc2nrmk / maxc2nrm
621 IF( maxc2nrmk.LE.abstol .OR. relmaxc2nrmk.LE.reltol )
THEN
645 IF( kb.LT.minmnupdt )
THEN
646 CALL cgemm(
'No transpose',
'Conjugate transpose',
647 $ m-
IF, n+nrhs-kb, kb,-cone, a( if+1, 1 ), lda,
648 $ f( kb+1, 1 ), ldf, cone, a( if+1, kb+1 ), lda )
689 CALL cswap( m, a( 1, kp ), 1, a( 1, k ), 1 )
690 CALL cswap( k-1, f( kp, 1 ), ldf, f( k, 1 ), ldf )
694 jpiv( kp ) = jpiv( k )
703 f( k, j ) = conjg( f( k, j ) )
705 CALL cgemv(
'No transpose', m-i+1, k-1, -cone, a( i, 1 ),
706 $ lda, f( k, 1 ), ldf, cone, a( i, k ), 1 )
708 f( k, j ) = conjg( f( k, j ) )
715 CALL clarfg( m-i+1, a( i, k ), a( i+1, k ), 1, tau( k ) )
730 IF( sisnan( real( tau(k) ) ) )
THEN
731 taunan = real( tau(k) )
732 ELSE IF( sisnan( aimag( tau(k) ) ) )
THEN
733 taunan = aimag( tau(k) )
738 IF( sisnan( taunan ) )
THEN
756 relmaxc2nrmk = taunan
770 IF( nrhs.GT.0 .AND. kb.LT.(m-ioffset) )
THEN
771 CALL cgemm(
'No transpose',
'Conjugate transpose',
772 $ m-
IF, nrhs, kb, -cone, a( if+1, 1 ), lda,
773 $ f( n+1, 1 ), ldf, cone, a( if+1, n+1 ), lda )
797 IF( k.LT.n+nrhs )
THEN
798 CALL cgemv(
'Conjugate transpose', m-i+1, n+nrhs-k,
799 $ tau( k ), a( i, k+1 ), lda, a( i, k ), 1,
800 $ czero, f( k+1, k ), 1 )
815 CALL cgemv(
'Conjugate Transpose', m-i+1, k-1, -tau( k ),
816 $ a( i, 1 ), lda, a( i, k ), 1, czero,
819 CALL cgemv(
'No transpose', n+nrhs, k-1, cone,
820 $ f( 1, 1 ), ldf, auxv( 1 ), 1, cone,
830 IF( k.LT.n+nrhs )
THEN
831 CALL cgemm(
'No transpose',
'Conjugate transpose',
832 $ 1, n+nrhs-k, k, -cone, a( i, 1 ), lda,
833 $ f( k+1, 1 ), ldf, cone, a( i, k+1 ), lda )
842 IF( k.LT.minmnfact )
THEN
845 IF( vn1( j ).NE.zero )
THEN
850 temp = abs( a( i, j ) ) / vn1( j )
851 temp = max( zero, ( one+temp )*( one-temp ) )
852 temp2 = temp*( vn1( j ) / vn2( j ) )**2
853 IF( temp2.LE.tol3z )
THEN
862 iwork( j-1 ) = lsticc
869 vn1( j ) = vn1( j )*sqrt( temp )
898 IF( kb.LT.minmnupdt )
THEN
899 CALL cgemm(
'No transpose',
'Conjugate transpose',
900 $ m-
IF, n+nrhs-kb, kb, -cone, a( if+1, 1 ), lda,
901 $ f( kb+1, 1 ), ldf, cone, a( if+1, kb+1 ), lda )
908 DO WHILE( lsticc.GT.0 )
914 itemp = iwork( lsticc-1 )
923 vn1( lsticc ) = scnrm2( m-
IF, a( if+1, lsticc ), 1 )
924 vn2( lsticc ) = vn1( lsticc )