1 SUBROUTINE pzlahrd( 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 COMPLEX*16 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.0d+0, 0.0d+0 ),
139 $ zero = ( 0.0d+0, 0.0d+0 ) )
143 INTEGER I, IACOL, IAROW, ICTXT, IOFF, II, J, JJ, JL,
144 $ jt, jw, l, myrow, mycol, npcol, nprow, nq
148 INTEGER DESCW( DLEN_ )
157 $ zaxpy, zcopy, zscal, ztrmv
169 ictxt = desca( ctxt_ )
170 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
172 ioff = mod( ja-1, desca( nb_ ) )
173 CALL infog2l( ia+k, ja, desca, nprow, npcol, myrow, mycol, ii,
176 iproc = ( myrow.EQ.iarow .AND. mycol.EQ.iacol )
177 nq = numroc( n+ja-1, desca( nb_ ), mycol, iacol, npcol )
184 CALL descset( descw, 1, desca( mb_ ), 1, desca( mb_ ), iarow,
197 CALL pzlacgv( l-1, a, i, ja, desca, desca( m_ ) )
198 CALL pzgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
199 $ a, i, ja, desca, desca( m_ ), one, a, ia, j,
201 CALL pzlacgv( l-1, a, i, ja, desca, desca( m_ ) )
214 CALL zcopy( l-1, a( (jj+l-2)*desca( lld_ )+ii ), 1,
216 CALL ztrmv(
'Lower',
'Conjugate transpose',
'Unit', l-1,
217 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
223 CALL pzgemv(
'Conjugate transpose', n-k-l+1, l-1, one, a,
224 $ i+1, ja, desca, a, i+1, j, desca, 1, one, work,
225 $ 1, jw, descw, descw( m_ ) )
230 $
CALL ztrmv(
'Upper',
'Conjugate transpose',
'Non-unit',
231 $ l-1, t, desca( nb_ ), work( jw ), 1 )
235 CALL pzgemv(
'No transpose', n-k-l+1, l-1, -one, a, i+1, ja,
236 $ desca, work, 1, jw, descw, descw( m_ ), one,
237 $ a, i+1, j, desca, 1 )
242 CALL ztrmv(
'Lower',
'No transpose',
'Unit', l-1,
243 $ a( (jj-1)*desca( lld_ )+ii ), desca( lld_ ),
245 CALL zaxpy( l-1, -one, work( jw ), 1,
246 $ a( ( jj+l-2 )*desca( lld_ )+ii ), 1 )
248 CALL pzelset( a, i, j-1, desca, ei )
254 CALL pzlarfg( n-k-l+1, ei, i+1, j, a,
min( i+2, n+ia-1 ), j,
256 CALL pzelset( a, i+1, j, desca, one )
260 CALL pzgemv(
'No transpose', n, n-k-l+1, one, a, ia, j+1,
261 $ desca, a, i+1, j, desca, 1, zero, y, iy, jy+l-1,
263 CALL pzgemv(
'Conjugate transpose', n-k-l+1, l-1, one, a, i+1,
264 $ ja, desca, a, i+1, j, desca, 1, zero, work, 1, jw,
265 $ descw, descw( m_ ) )
266 CALL pzgemv(
'No transpose', n, l-1, -one, y, iy, jy, descy,
267 $ work, 1, jw, descw, descw( m_ ), one, y, iy,
269 jl =
min( jj+l-1, ja+nq-1 )
270 CALL pzscal( n, tau( jl ), y, iy, jy+l-1, descy, 1 )
275 jt = ( l-1 ) * desca( nb_ )
276 CALL zscal( l-1, -tau( jl ), work( jw ), 1 )
277 CALL zcopy( l-1, work( jw ), 1, t( jt+1 ), 1 )
278 CALL ztrmv(
'Upper',
'No transpose',
'Non-unit', l-1, t,
279 $ desca( nb_ ), t( jt+1 ), 1 )
280 t( jt+l ) = tau( jl )
284 CALL pzelset( a, k+nb+ia-1, j, desca, ei )