3 SUBROUTINE pclaghe( N, K, D, A, IA, JA, DESCA, ISEED, ORDER, WORK,
13 INTEGER IA, INFO, JA, K, LWORK, N, ORDER
16 INTEGER DESCA( * ), ISEED( 4 )
18 COMPLEX A( * ), WORK( * )
145 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
146 $ mb_, nb_, rsrc_, csrc_, lld_
147 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
148 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
149 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
151 parameter( czero = 0.0e+0 )
154 INTEGER CSRC_A, I, IACOL, IAROW, ICOFFA, II, IIROW,
155 $ indaa, indtau, indwork, ipostpad, iprepad,
156 $ iroffa, isizeheevx, isizesubtst, isizetst,
157 $ jjcol, ldaa, lii, liii, ljj, ljjj, lwmin, maxi,
158 $ mb_a, mycol, myrow, nb_a, np, npcol, nprow, nq,
159 $ rsizechk, rsizeheevx, rsizeqtq, rsizesubtst,
160 $ rsizetst, rsrc_a, sizeheevx, sizemqrleft,
161 $ sizemqrright, sizeqrf, sizesubtst, sizetms,
162 $ sizetst, sizeheevd, rsizeheevd, isizeheevd
169 INTEGER INDXG2P, NUMROC
170 EXTERNAL indxg2p, numroc
178 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
183 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
188 IF( nprow.EQ.-1 )
THEN
189 info = -( 700+ctxt_ )
191 CALL chk1mat( n, 1, n, 1, ia, ja, desca, 7, info )
197 rsrc_a = desca( rsrc_ )
198 csrc_a = desca( csrc_ )
199 iarow = indxg2p( ia, mb_a, myrow, rsrc_a, nprow )
200 iacol = indxg2p( ja, nb_a, mycol, csrc_a, npcol )
201 iroffa = mod( ia-1, mb_a )
202 icoffa = mod( ja-1, nb_a )
203 np = numroc( n+iroffa, mb_a, myrow, iarow, nprow )
204 nq = numroc( n+icoffa, nb_a, mycol, iacol, npcol )
207 CALL pclasizesep( desca, iprepad, ipostpad, sizemqrleft,
208 $ sizemqrright, sizeqrf, sizetms, rsizeqtq,
209 $ rsizechk, sizeheevx, rsizeheevx, isizeheevx,
210 $ sizeheevd, rsizeheevd, isizeheevd,
211 $ sizesubtst, rsizesubtst, isizesubtst, sizetst,
212 $ rsizetst, isizetst )
218 IF( k.LT.0 .OR. k.GT.n-1 )
THEN
220 ELSE IF( n.NE.order )
THEN
222 ELSE IF( lwork.LT.lwmin )
THEN
227 CALL pxerbla( desca( ctxt_ ),
'PCLAGHE', -info )
232 indtau = indaa + ldaa*
max( 1, nq )
233 indwork = indtau +
max( 1, nq )
236 CALL claset(
'A', ldaa, nq, czero, czero, work( indaa ), ldaa )
242 CALL pcmatgen( desca( ctxt_ ),
'N',
'N', n, order,
243 $ desca( mb_ ), desca( nb_ ), work( indaa ),
244 $ desca( lld_ ), desca( rsrc_ ), desca( csrc_ ),
245 $ iseed( 1 ), 0, np, 0, nq, myrow, mycol, nprow,
247 CALL pcgeqrf( n, order, work( indaa ), ia, ja, desca,
248 $ work( indtau ), work( indwork ), sizeqrf, info )
254 CALL claset(
'A', np, nq, czero, czero, a, desca( lld_ ) )
261 DO 20 ii = 1, n, desca( mb_ )
262 maxi =
min( n, ii+desca( mb_ )-1 )
263 IF( ( myrow.EQ.iirow ) .AND. ( mycol.EQ.jjcol ) )
THEN
267 a( liii+( ljjj-1 )*desca( lld_ ) ) = d( i )
273 $ lii = lii + desca( mb_ )
275 $ ljj = ljj + desca( mb_ )
276 iirow = mod( iirow+1, nprow )
277 jjcol = mod( jjcol+1, npcol )
284 CALL pcunmqr(
'L',
'Conjugate transpose', n, n, order,
285 $ work( indaa ), ia, ja, desca, work( indtau ), a,
286 $ ia, ja, desca, work( indwork ), sizemqrleft,
293 CALL pcunmqr(
'R',
'N', n, n, order, work( indaa ), ia, ja,
294 $ desca, work( indtau ), a, ia, ja, desca,
295 $ work( indwork ), sizemqrright, info )