331 SUBROUTINE zlaqp2rk( M, N, NRHS, IOFFSET, KMAX, ABSTOL, RELTOL,
332 $ KP1, MAXC2NRM, A, LDA, K, MAXC2NRMK,
333 $ RELMAXC2NRMK, JPIV, TAU, VN1, VN2, WORK,
342 INTEGER INFO, IOFFSET, KP1, K, KMAX, LDA, M, N, NRHS
343 DOUBLE PRECISION ABSTOL, MAXC2NRM, MAXC2NRMK, RELMAXC2NRMK,
348 DOUBLE PRECISION VN1( * ), VN2( * )
349 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
355 DOUBLE PRECISION ZERO, ONE
356 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
357 COMPLEX*16 CZERO, CONE
358 parameter( czero = ( 0.0d+0, 0.0d+0 ),
359 $ cone = ( 1.0d+0, 0.0d+0 ) )
362 INTEGER I, ITEMP, J, JMAXC2NRM, KK, KP, MINMNFACT,
364 DOUBLE PRECISION HUGEVAL, TAUNAN, TEMP, TEMP2, TOL3Z
370 INTRINSIC abs, dble, dconjg, dimag, max, min, sqrt
375 DOUBLE PRECISION DLAMCH, DZNRM2
376 EXTERNAL disnan, dlamch, idamax, dznrm2
392 minmnfact = min( m-ioffset, n )
393 minmnupdt = min( m-ioffset, n+nrhs )
394 kmax = min( kmax, minmnfact )
395 tol3z = sqrt( dlamch(
'Epsilon' ) )
396 hugeval = dlamch(
'Overflow' )
424 kp = ( kk-1 ) + idamax( n-kk+1, vn1( kk ), 1 )
431 maxc2nrmk = vn1( kp )
443 IF( disnan( maxc2nrmk ) )
THEN
453 relmaxc2nrmk = maxc2nrmk
470 IF( maxc2nrmk.EQ.zero )
THEN
502 IF( info.EQ.0 .AND. maxc2nrmk.GT.hugeval )
THEN
503 info = n + kk - 1 + kp
518 relmaxc2nrmk = maxc2nrmk / maxc2nrm
520 IF( maxc2nrmk.LE.abstol .OR. relmaxc2nrmk.LE.reltol )
THEN
559 CALL zswap( m, a( 1, kp ), 1, a( 1, kk ), 1 )
560 vn1( kp ) = vn1( kk )
561 vn2( kp ) = vn2( kk )
563 jpiv( kp ) = jpiv( kk )
573 CALL zlarfg( m-i+1, a( i, kk ), a( i+1, kk ), 1,
589 IF( disnan( dble( tau(kk) ) ) )
THEN
590 taunan = dble( tau(kk) )
591 ELSE IF( disnan( dimag( tau(kk) ) ) )
THEN
592 taunan = dimag( tau(kk) )
597 IF( disnan( taunan ) )
THEN
604 relmaxc2nrmk = taunan
624 IF( kk.LT.minmnupdt )
THEN
625 CALL zlarf1f(
'Left', m-i+1, n+nrhs-kk, a( i, kk ), 1,
626 $ conjg( tau( kk ) ), a( i, kk+1 ), lda,
630 IF( kk.LT.minmnfact )
THEN
637 IF( vn1( j ).NE.zero )
THEN
642 temp = one - ( abs( a( i, j ) ) / vn1( j ) )**2
643 temp = max( temp, zero )
644 temp2 = temp*( vn1( j ) / vn2( j ) )**2
645 IF( temp2 .LE. tol3z )
THEN
652 vn1( j ) = dznrm2( m-i, a( i+1, j ), 1 )
662 vn1( j ) = vn1( j )*sqrt( temp )
684 IF( k.LT.minmnfact )
THEN
686 jmaxc2nrm = k + idamax( n-k, vn1( k+1 ), 1 )
687 maxc2nrmk = vn1( jmaxc2nrm )
692 relmaxc2nrmk = maxc2nrmk / maxc2nrm
704 DO j = k + 1, minmnfact
subroutine zlaqp2rk(m, n, nrhs, ioffset, kmax, abstol, reltol, kp1, maxc2nrm, a, lda, k, maxc2nrmk, relmaxc2nrmk, jpiv, tau, vn1, vn2, work, info)
ZLAQP2RK computes truncated QR factorization with column pivoting of a complex matrix block using Lev...