172 SUBROUTINE slaqps( M, N, OFFSET, NB, KB, A, LDA, JPVT, TAU,
174 $ VN2, AUXV, F, LDF )
181 INTEGER KB, LDA, LDF, M, N, NB, OFFSET
185 REAL A( LDA, * ), AUXV( * ), F( LDF, * ), TAU( * ),
193 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
196 INTEGER ITEMP, J, K, LASTRK, LSTICC, PVT, RK
197 REAL AKK, TEMP, TEMP2, TOL3Z
203 INTRINSIC abs, max, min, nint, real, sqrt
208 EXTERNAL isamax, slamch, snrm2
212 lastrk = min( m, n+offset )
215 tol3z = sqrt(slamch(
'Epsilon'))
220 IF( ( k.LT.nb ) .AND. ( lsticc.EQ.0 ) )
THEN
226 pvt = ( k-1 ) + isamax( n-k+1, vn1( k ), 1 )
228 CALL sswap( m, a( 1, pvt ), 1, a( 1, k ), 1 )
229 CALL sswap( k-1, f( pvt, 1 ), ldf, f( k, 1 ), ldf )
231 jpvt( pvt ) = jpvt( k )
233 vn1( pvt ) = vn1( k )
234 vn2( pvt ) = vn2( k )
241 CALL sgemv(
'No transpose', m-rk+1, k-1, -one, a( rk,
243 $ lda, f( k, 1 ), ldf, one, a( rk, k ), 1 )
249 CALL slarfg( m-rk+1, a( rk, k ), a( rk+1, k ), 1,
252 CALL slarfg( 1, a( rk, k ), a( rk, k ), 1, tau( k ) )
263 CALL sgemv(
'Transpose', m-rk+1, n-k, tau( k ),
264 $ a( rk, k+1 ), lda, a( rk, k ), 1, zero,
279 CALL sgemv(
'Transpose', m-rk+1, k-1, -tau( k ), a( rk,
281 $ lda, a( rk, k ), 1, zero, auxv( 1 ), 1 )
283 CALL sgemv(
'No transpose', n, k-1, one, f( 1, 1 ), ldf,
284 $ auxv( 1 ), 1, one, f( 1, k ), 1 )
291 CALL sgemv(
'No transpose', n-k, k, -one, f( k+1, 1 ),
293 $ a( rk, 1 ), lda, one, a( rk, k+1 ), lda )
298 IF( rk.LT.lastrk )
THEN
300 IF( vn1( j ).NE.zero )
THEN
305 temp = abs( a( rk, j ) ) / vn1( j )
306 temp = max( zero, ( one+temp )*( one-temp ) )
307 temp2 = temp*( vn1( j ) / vn2( j ) )**2
308 IF( temp2 .LE. tol3z )
THEN
309 vn2( j ) = real( lsticc )
312 vn1( j ) = vn1( j )*sqrt( temp )
331 IF( kb.LT.min( n, m-offset ) )
THEN
332 CALL sgemm(
'No transpose',
'Transpose', m-rk, n-kb, kb,
334 $ a( rk+1, 1 ), lda, f( kb+1, 1 ), ldf, one,
335 $ a( rk+1, kb+1 ), lda )
341 IF( lsticc.GT.0 )
THEN
342 itemp = nint( vn2( lsticc ) )
343 vn1( lsticc ) = snrm2( m-rk, a( rk+1, lsticc ), 1 )
349 vn2( lsticc ) = vn1( lsticc )
subroutine slaqps(m, n, offset, nb, kb, a, lda, jpvt, tau, vn1, vn2, auxv, f, ldf)
SLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BL...