1 SUBROUTINE pslahrd( N, K, NB, A, IA, JA, DESCA, TAU, T, Y, IY, JY,
10 INTEGER IA, IY, JA, JY, K, N, NB
13 INTEGER DESCA( * ), DESCY( * )
14 REAL A( * ), T( * ), TAU( * ), WORK( * ), Y( * )
132 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
133 $ lld_, mb_, m_, nb_, n_, rsrc_
134 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
135 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
136 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
138 parameter( one = 1.0e+0, zero = 0.0e+0 )
142 INTEGER I, IACOL, IAROW, ICTXT, IOFF, II, J, JJ, JL,
143 $ jt, jw, l, myrow, mycol, npcol, nprow, nq
147 INTEGER DESCW( DLEN_ )
155 $ psgemv,
pslarfg, psscal, saxpy,
156 $ scopy, sscal, strmv
168 ictxt = desca( ctxt_ )
169 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
171 ioff = mod( ja-1, desca( nb_ ) )
172 CALL infog2l( ia+k, ja, desca, nprow, npcol, myrow, mycol, ii,
175 iproc = ( myrow.EQ.iarow .AND. mycol.EQ.iacol )
176 nq = numroc( n+ja-1, desca( nb_ ), mycol, iacol, npcol )
183 CALL descset( descw, 1, desca( mb_ ), 1, desca( mb_ ), iarow,
196 CALL psgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
197 $ a, i, ja, desca, desca( m_ ), one, a, ia, j,
211 CALL scopy( l-1, a( (jj+l-2)*desca( lld_ )+ii ), 1,
213 CALL strmv(
'Lower',
'Transpose',
'Unit', l-1,
214 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
220 CALL psgemv(
'Transpose', n-k-l+1, l-1, one, a, i+1, ja,
221 $ desca, a, i+1, j, desca, 1, one, work, 1, jw,
222 $ descw, descw( m_ ) )
227 $
CALL strmv(
'Upper',
'Transpose',
'Non-unit', l-1, t,
228 $ desca( nb_ ), work( jw ), 1 )
232 CALL psgemv(
'No transpose', n-k-l+1, l-1, -one, a, i+1, ja,
233 $ desca, work, 1, jw, descw, descw( m_ ), one,
234 $ a, i+1, j, desca, 1 )
239 CALL strmv(
'Lower',
'No transpose',
'Unit', l-1,
240 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
242 CALL saxpy( l-1, -one, work( jw ), 1,
243 $ a( ( jj+l-2 )*desca( lld_ )+ii ), 1 )
245 CALL pselset( a, i, j-1, desca, ei )
251 CALL pslarfg( n-k-l+1, ei, i+1, j, a,
min( i+2, n+ia-1 ), j,
253 CALL pselset( a, i+1, j, desca, one )
257 CALL psgemv(
'No transpose', n, n-k-l+1, one, a, ia, j+1,
258 $ desca, a, i+1, j, desca, 1, zero, y, iy, jy+l-1,
260 CALL psgemv(
'Transpose', n-k-l+1, l-1, one, a, i+1, ja, desca,
261 $ a, i+1, j, desca, 1, zero, work, 1, jw, descw,
263 CALL psgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
264 $ work, 1, jw, descw, descw( m_ ), one, y, iy,
266 jl =
min( jj+l-1, ja+nq-1 )
267 CALL psscal( n, tau( jl ), y, iy, jy+l-1, descy, 1 )
272 jt = ( l-1 ) * desca( nb_ )
273 CALL sscal( l-1, -tau( jl ), work( jw ), 1 )
274 CALL scopy( l-1, work( jw ), 1, t( jt+1 ), 1 )
275 CALL strmv(
'Upper',
'No transpose',
'Non-unit', l-1, t,
276 $ desca( nb_ ), t( jt+1 ), 1 )
277 t( jt+l ) = tau( jl )
281 CALL pselset( a, k+nb+ia-1, j, desca, ei )