1 SUBROUTINE pdgehd2( N, ILO, IHI, A, IA, JA, DESCA, TAU, WORK,
10 INTEGER IA, IHI, ILO, INFO, JA, LWORK, N
14 DOUBLE PRECISION A( * ), TAU( * ), WORK( * )
192 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
193 $ lld_, mb_, m_, nb_, n_, rsrc_
194 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
195 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
196 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
198 parameter( one = 1.0d+0 )
202 INTEGER I, IAROW, ICOFFA, ICTXT, IROFFA, J, K, LWMIN,
203 $ mycol, myrow, npa0, npcol, nprow
211 INTEGER INDXG2P, NUMROC
212 EXTERNAL indxg2p, numroc
215 INTRINSIC dble,
max,
min, mod
221 ictxt = desca( ctxt_ )
222 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
227 IF( nprow.EQ.-1 )
THEN
230 CALL chk1mat( n, 1, n, 1, ia, ja, desca, 7, info )
232 iroffa = mod( ia-1, desca( mb_ ) )
233 icoffa = mod( ja-1, desca( nb_ ) )
234 iarow = indxg2p( ia, desca( mb_ ), myrow, desca( rsrc_ ),
236 npa0 = numroc( ihi+iroffa, desca( mb_ ), myrow, iarow,
238 lwmin = desca( nb_ ) +
max( npa0, desca( nb_ ) )
240 work( 1 ) = dble( lwmin )
241 lquery = ( lwork.EQ.-1 )
242 IF( ilo.LT.1 .OR. ilo.GT.
max( 1, n ) )
THEN
244 ELSE IF( ihi.LT.
min( ilo, n ) .OR. ihi.GT.n )
THEN
246 ELSE IF( iroffa.NE.icoffa )
THEN
248 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
250 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
257 CALL pxerbla( ictxt,
'PDGEHD2', -info )
258 CALL blacs_abort( ictxt, 1 )
260 ELSE IF( lquery )
THEN
271 CALL pdlarfg( ihi-k, aii, i+1, j, a,
min( i+2, n+ia-1 ), j,
273 CALL pdelset( a, i+1, j, desca, one )
277 CALL pdlarf(
'Right', ihi, ihi-k, a, i+1, j, desca, 1, tau, a,
278 $ ia, j+1, desca, work )
282 CALL pdlarf(
'Left', ihi-k, n-k, a, i+1, j, desca, 1, tau, a,
283 $ i+1, j+1, desca, work )
285 CALL pdelset( a, i+1, j, desca, aii )
288 work( 1 ) = dble( lwmin )