1 SUBROUTINE psggqrf( N, M, P, A, IA, JA, DESCA, TAUA, B, IB, JB,
2 $ DESCB, TAUB, WORK, LWORK, INFO )
10 INTEGER IA, IB, INFO, JA, JB, LWORK, , N, P
13 INTEGER DESCA( * ), DESCB( * )
14 REAL A( * ), B( * ), TAUA( * ), TAUB( * ), WORK( * )
257 INTEGER , CSRC_, CTXT_, DLEN_, DTYPE_,
258 $ lld_, mb_, m_, nb_, n_, rsrc_
259 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
260 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
265 INTEGER IACOL, IAROW, IBCOL, IBROW
267 $ myrow, npa0, npb0, npcol, nprow, pqb0
274 INTEGER IDUM1( 1 ), IDUM2( 1 )
281 INTRINSIC int,
max,
min, mod, real
293 IF( nprow.EQ.-1 )
THEN
297 CALL chk1mat( n, 1, p, 3, ib, jb, descb, 12, info )
301 iroffb = mod( ib-1, descb( mb_ ) )
305 iacol =
indxg2p( ja, desca( nb_ ), mycol, desca( csrc_ ),
307 ibrow =
indxg2p( ib, descb( mb_ ), myrow, descb( rsrc_ ),
311 npa0 = numroc( n+iroffa, desca
312 mqa0 = numroc( m+icoffa, desca( nb_ ), mycol, iacol, npcol )
313 npb0 = numroc( n+iroffb, descb( mb_ ), myrow, ibrow, nprow )
314 pqb0 = numroc( p+icoffb, descb( nb_ ), mycol, ibcol, npcol )
315 lwmin =
max( desca( nb_ ) * ( npa0 + mqa0 + desca( nb_ ) ),
316 $
max(
max( ( desca( nb_ )*( desca( nb_ ) - 1 ) ) / 2,
317 $ ( pqb0 + npb0 ) * desca( nb_ ) ) +
318 $ desca( nb_ ) * desca( nb_ ),
319 $ descb( mb_ ) * ( npb0 + pqb0 + descb( mb_ ) ) ) )
321 work( 1 ) = real( lwmin )
322 lquery = ( lwork.EQ.-1 )
323 IF( iarow.NE.ibrow .OR. iroffa.NE.iroffb )
THEN
325 ELSE IF( desca( mb_ ).NE.descb( mb_ ) )
THEN
327 ELSE IF( ictxt.NE.descb( ctxt_ ) )
THEN
329 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
339 CALL pchk2mat( n, 1, m, 2, ia, ja, desca, 7, n, 1, p, 3,
340 $ jb, descb, 12, 1, idum1, idum2, info )
344 CALL pxerbla( ictxt,
'PSGGQRF', -info )
346 ELSE IF( lquery )
THEN
352 CALL psgeqrf( n, m, a, ia, ja, desca, taua
353 lwmin = int( work( 1 ) )
357 CALL psormqr(
'Left',
'Transpose', n, p,
min( n, m ), a, ia, ja,
358 $ desca, taua, b, ib, jb, descb, work, lwork
359 lwmin =
min( lwmin, int( work( 1 ) ) )
363 CALL psgerqf( n, p, b, ib, jb, descb, taub, work, lwork, info )
364 work( 1 ) = real(
max( lwmin, int( work( 1 ) ) ) )
subroutine pchk2mat(ma, mapos0, na, napos0, ia, ja, desca, descapos0, mb, mbpos0, nb, nbpos0, ib, jb, descb, descbpos0, nextra, ex, expos, info)