3 SUBROUTINE pssygst( IBTYPE, UPLO, N, A, IA, JA, DESCA, B, IB, JB,
13 INTEGER IA, IB, IBTYPE, INFO, JA, JB, N
17 INTEGER DESCA( * ), DESCB( * )
170 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
171 $ mb_, nb_, rsrc_, csrc_, lld_
172 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
173 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
174 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
176 parameter( one = 1.0e+0, half = 0.5e+0 )
180 INTEGER IACOL, IAROW, IBCOL, IBROW, ICOFFA, ICOFFB,
181 $ ictxt, iroffa, iroffb, k, kb, mycol, myrow, nb,
185 INTEGER IDUM1( 2 ), IDUM2( 2 )
189 $ pssymm, pssyr2k, pstrmm, pstrsm,
pxerbla
192 INTRINSIC ichar,
min, mod
196 INTEGER ICEIL, INDXG2P
197 EXTERNAL lsame, iceil, indxg2p
201 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
208 ictxt = desca( ctxt_ )
209 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
214 IF( nprow.EQ.-1 )
THEN
215 info = -( 700+ctxt_ )
217 upper = lsame( uplo,
'U' )
218 CALL chk1mat( n, 3, n, 3, ia, ja, desca, 7, info )
219 CALL chk1mat( n, 3, n, 3, ib, jb, descb, 11, info )
221 iarow = indxg2p( ia, desca( mb_ ), myrow, desca( rsrc_ ),
223 ibrow = indxg2p( ib, descb( mb_ ), myrow, descb( rsrc_ ),
225 iacol = indxg2p( ja, desca( nb_ ), mycol, desca( csrc_ ),
227 ibcol = indxg2p( jb, descb( nb_ ), mycol, descb( csrc_ ),
229 iroffa = mod( ia-1, desca( mb_ ) )
230 icoffa = mod( ja-1, desca( nb_ ) )
231 iroffb = mod( ib-1, descb( mb_ ) )
232 icoffb = mod( jb-1, descb( nb_ ) )
233 IF( ibtype.LT.1 .OR. ibtype.GT.3 )
THEN
235 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
237 ELSE IF( n.LT.0 )
THEN
239 ELSE IF( iroffa.NE.0 )
THEN
241 ELSE IF( icoffa.NE.0 )
THEN
243 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
245 ELSE IF( iroffb.NE.0 .OR. ibrow.NE.iarow )
THEN
247 ELSE IF( icoffb.NE.0 .OR. ibcol.NE.iacol )
THEN
249 ELSE IF( descb( mb_ ).NE.desca( mb_ ) )
THEN
251 ELSE IF( descb( nb_ ).NE.desca( nb_ ) )
THEN
253 ELSE IF( ictxt.NE.descb( ctxt_ ) )
THEN
254 info = -( 1100+ctxt_ )
260 idum1( 2 ) = ichar(
'U' )
262 idum1( 2 ) = ichar(
'L' )
265 CALL pchk2mat( n, 3, n, 3, ia, ja, desca, 7, n, 3, n, 3, ib,
266 $ jb, descb, 11, 2, idum1, idum2, info )
270 CALL pxerbla( ictxt,
'PSSYGST', -info )
279 IF( ibtype.EQ.1 )
THEN
286 kb =
min( iceil( ja, nb )*nb, ja+n-1 ) - ja + 1
292 CALL pssygs2( ibtype, uplo, kb, a, ia+k-1, ja+k-1, desca, b,
293 $ ib+k-1, ib+k-1, descb, info )
295 CALL pstrsm(
'Left', uplo,
'Transpose',
'Non-unit', kb,
296 $ n-k-kb+1, one, b, ib+k-1, jb+k-1, descb, a,
297 $ ia+k-1, ja+k+kb-1, desca )
298 CALL pssymm(
'Left', uplo, kb, n-k-kb+1, -half, a,
299 $ ia+k-1, ja+k-1, desca, b, ib+k-1, jb+k+kb-1,
300 $ descb, one, a, ia+k-1, ja+k+kb-1, desca )
301 CALL pssyr2k( uplo,
'Transpose', n-k-kb+1, kb, -one, a,
302 $ ia+k-1, ja+k+kb-1, desca, b, ib+k-1,
303 $ jb+k+kb-1, descb, one, a, ia+k+kb-1,
305 CALL pssymm(
'Left', uplo, kb, n-k-kb+1, -half, a,
306 $ ia+k-1, ja+k-1, desca, b, ib+k-1, jb+k+kb-1,
307 $ descb, one, a, ia+k-1, ja+k+kb-1, desca )
308 CALL pstrsm(
'Right', uplo,
'No transpose',
'Non-unit',
309 $ kb, n-k-kb+1, one, b, ib+k+kb-1, jb+k+kb-1,
310 $ descb, a, ia+k-1, ja+k+kb-1, desca )
313 kb =
min( n-k+1, nb )
324 kb =
min( iceil( ia, nb )*nb, ia+n-1 ) - ia + 1
330 CALL pssygs2( ibtype, uplo, kb, a, ia+k-1, ja+k-1, desca, b,
331 $ ib+k-1, jb+k-1, descb, info )
333 CALL pstrsm(
'Right', uplo,
'Transpose',
'Non-unit',
334 $ n-k-kb+1, kb, one, b, ib+k-1, jb+k-1, descb,
335 $ a, ia+k+kb-1, ja+k-1, desca )
336 CALL pssymm(
'Right', uplo, n-k-kb+1, kb, -half, a,
337 $ ia+k-1, ja+k-1, desca, b, ib+k+kb-1, jb+k-1,
338 $ descb, one, a, ia+k+kb-1, ja+k-1, desca )
339 CALL pssyr2k( uplo,
'No transpose', n-k-kb+1, kb, -one,
340 $ a, ia+k+kb-1, ja+k-1, desca, b, ib+k+kb-1,
341 $ jb+k-1, descb, one, a, ia+k+kb-1,
343 CALL pssymm(
'Right', uplo, n-k-kb+1, kb, -half, a,
344 $ ia+k-1, ja+k-1, desca, b, ib+k+kb-1, jb+k-1,
345 $ descb, one, a, ia+k+kb-1, ja+k-1, desca )
346 CALL pstrsm(
'Left', uplo,
'No transpose',
'Non-unit',
347 $ n-k-kb+1, kb, one, b, ib+k+kb-1, jb+k+kb-1,
348 $ descb, a, ia+k+kb-1, ja+k-1, desca )
351 kb =
min( n-k+1, nb )
366 kb =
min( iceil( ja, nb )*nb, ja+n-1 ) - ja + 1
372 CALL pstrmm(
'Left', uplo,
'No transpose',
'Non-unit', k-1,
373 $ kb, one, b, ib, jb, descb, a, ia, ja+k-1,
375 CALL pssymm(
'Right', uplo, k-1, kb, half, a, ia+k-1,
376 $ ja+k-1, desca, b, ib, jb+k-1, descb, one, a,
377 $ ia, ja+k-1, desca )
378 CALL pssyr2k( uplo,
'No transpose', k-1, kb, one, a, ia,
379 $ ja+k-1, desca, b, ib, jb+k-1, descb, one, a,
381 CALL pssymm(
'Right', uplo, k-1, kb, half, a, ia+k-1,
382 $ ja+k-1, desca, b, ib, jb+k-1, descb, one, a,
383 $ ia, ja+k-1, desca )
384 CALL pstrmm(
'Right', uplo,
'Transpose',
'Non-unit', k-1,
385 $ kb, one, b, ib+k-1, jb+k-1, descb, a, ia,
387 CALL pssygs2( ibtype, uplo, kb, a, ia+k-1, ja+k-1, desca, b,
388 $ ib+k-1, jb+k-1, descb, info )
391 kb =
min( n-k+1, nb )
402 kb =
min( iceil( ia, nb )*nb, ia+n-1 ) - ia + 1
408 CALL pstrmm(
'Right', uplo,
'No transpose',
'Non-unit', kb,
409 $ k-1, one, b, ib, jb, descb, a, ia+k-1, ja,
411 CALL pssymm(
'Left', uplo, kb, k-1, half, a, ia+k-1, ja+k-1,
412 $ desca, b, ib+k-1, jb, descb, one, a, ia+k-1,
414 CALL pssyr2k( uplo,
'Transpose', k-1, kb, one, a, ia+k-1,
415 $ ja, desca, b, ib+k-1, jb, descb, one, a, ia,
417 CALL pssymm(
'Left', uplo, kb, k-1, half, a, ia+k-1, ja+k-1,
418 $ desca, b, ib+k-1, jb, descb, one, a, ia+k-1,
420 CALL pstrmm(
'Left', uplo,
'Transpose',
'Non-unit', kb, k-1,
421 $ one, b, ib+k-1, jb+k-1, descb, a, ia+k-1, ja,
423 CALL pssygs2( ibtype, uplo, kb, a, ia+k-1, ja+k-1, desca, b,
424 $ ib+k-1, jb+k-1, descb, info )
427 kb =
min( n-k+1, nb )