171 SUBROUTINE zlaqps( M, N, OFFSET, NB, KB, A, LDA, JPVT, TAU,
173 $ VN2, AUXV, F, LDF )
180 INTEGER KB, LDA, LDF, M, N, NB, OFFSET
184 DOUBLE PRECISION VN1( * ), VN2( * )
185 COMPLEX*16 A( LDA, * ), AUXV( * ), F( LDF, * ), TAU( * )
191 DOUBLE PRECISION ZERO, ONE
192 COMPLEX*16 CZERO, CONE
193 parameter( zero = 0.0d+0, one = 1.0d+0,
194 $ czero = ( 0.0d+0, 0.0d+0 ),
195 $ cone = ( 1.0d+0, 0.0d+0 ) )
198 INTEGER ITEMP, J, K, LASTRK, LSTICC, PVT, RK
199 DOUBLE PRECISION TEMP, TEMP2, TOL3Z
206 INTRINSIC abs, dble, dconjg, max, min, nint, sqrt
210 DOUBLE PRECISION DLAMCH, DZNRM2
211 EXTERNAL idamax, dlamch, dznrm2
215 lastrk = min( m, n+offset )
218 tol3z = sqrt(dlamch(
'Epsilon'))
223 IF( ( k.LT.nb ) .AND. ( lsticc.EQ.0 ) )
THEN
229 pvt = ( k-1 ) + idamax( n-k+1, vn1( k ), 1 )
231 CALL zswap( m, a( 1, pvt ), 1, a( 1, k ), 1 )
232 CALL zswap( k-1, f( pvt, 1 ), ldf, f( k, 1 ), ldf )
234 jpvt( pvt ) = jpvt( k )
236 vn1( pvt ) = vn1( k )
237 vn2( pvt ) = vn2( k )
245 f( k, j ) = dconjg( f( k, j ) )
247 CALL zgemv(
'No transpose', m-rk+1, k-1, -cone, a( rk,
249 $ lda, f( k, 1 ), ldf, cone, a( rk, k ), 1 )
251 f( k, j ) = dconjg( f( k, j ) )
258 CALL zlarfg( m-rk+1, a( rk, k ), a( rk+1, k ), 1,
261 CALL zlarfg( 1, a( rk, k ), a( rk, k ), 1, tau( k ) )
272 CALL zgemv(
'Conjugate transpose', m-rk+1, n-k, tau( k ),
273 $ a( rk, k+1 ), lda, a( rk, k ), 1, czero,
288 CALL zgemv(
'Conjugate transpose', m-rk+1, k-1,
290 $ a( rk, 1 ), lda, a( rk, k ), 1, czero,
293 CALL zgemv(
'No transpose', n, k-1, cone, f( 1, 1 ), ldf,
294 $ auxv( 1 ), 1, cone, f( 1, k ), 1 )
301 CALL zgemm(
'No transpose',
'Conjugate transpose', 1,
303 $ k, -cone, a( rk, 1 ), lda, f( k+1, 1 ), ldf,
304 $ cone, a( rk, k+1 ), lda )
309 IF( rk.LT.lastrk )
THEN
311 IF( vn1( j ).NE.zero )
THEN
316 temp = abs( a( rk, j ) ) / vn1( j )
317 temp = max( zero, ( one+temp )*( one-temp ) )
318 temp2 = temp*( vn1( j ) / vn2( j ) )**2
319 IF( temp2 .LE. tol3z )
THEN
320 vn2( j ) = dble( lsticc )
323 vn1( j ) = vn1( j )*sqrt( temp )
342 IF( kb.LT.min( n, m-offset ) )
THEN
343 CALL zgemm(
'No transpose',
'Conjugate transpose', m-rk,
345 $ kb, -cone, a( rk+1, 1 ), lda, f( kb+1, 1 ), ldf,
346 $ cone, a( rk+1, kb+1 ), lda )
352 IF( lsticc.GT.0 )
THEN
353 itemp = nint( vn2( lsticc ) )
354 vn1( lsticc ) = dznrm2( m-rk, a( rk+1, lsticc ), 1 )
360 vn2( lsticc ) = vn1( lsticc )