3 SUBROUTINE pzlatms( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
4 $ KL, KU, PACK, A, IA, JA, DESCA, ORDER, WORK,
13 CHARACTER DIST, PACK, SYM
14 INTEGER IA, INFO, JA, KL, KU, LWORK, M, MODE, N, ORDER
15 DOUBLE PRECISION COND, DMAX
18 INTEGER DESCA( * ), ISEED( 4 )
19 DOUBLE PRECISION D( * )
20 COMPLEX*16 A( * ), WORK( * )
200 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
201 $ MB_, NB_, RSRC_, CSRC_, LLD_
202 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
203 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
204 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
205 DOUBLE PRECISION ZERO, ONE
206 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
208 parameter( zzero = ( 0.0d+0, 0.0d+0 ) )
211 INTEGER I, IDIST, IINFO, IPACK, IRSIGN, ISYM, LLB,
212 $ MNMIN, MYCOL, MYROW, NP, NPCOL, NPROW, NQ
213 DOUBLE PRECISION ALPHA, TEMP
216 INTEGER IDUM1( 1 ), IDUM2( 1 )
221 EXTERNAL lsame, numroc
228 INTRINSIC abs,
max,
min, mod
232 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
241 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
242 IF( ( myrow.GE.nprow .OR. myrow.LT.0 ) .OR.
243 $ ( mycol.GE.npcol .OR. mycol.LT.0 ) )
RETURN
245 np = numroc( n, desca( mb_ ), myrow, 0, nprow )
246 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
250 IF( m.EQ.0 .OR. n.EQ.0 )
255 IF( lsame( dist,
'U' ) )
THEN
257 ELSE IF( lsame( dist,
'S' ) )
THEN
259 ELSE IF( lsame( dist,
'N' ) )
THEN
267 IF( lsame( sym,
'N' ) )
THEN
270 ELSE IF( lsame( sym,
'P' ) )
THEN
273 ELSE IF( lsame( sym,
'S' ) )
THEN
276 ELSE IF( lsame( sym,
'H' ) )
THEN
285 IF( lsame( pack,
'N' ) )
THEN
301 IF( nprow.EQ.-1 )
THEN
302 info = -( 1600+ctxt_ )
304 CALL chk1mat( m, 1, n, 2, ia, ja, desca, 16, info )
306 IF( m.NE.n .AND. isym.NE.1 )
THEN
308 ELSE IF( idist.EQ.-1 )
THEN
310 ELSE IF( isym.EQ.-1 )
THEN
312 ELSE IF( abs( mode ).GT.6 )
THEN
314 ELSE IF( ( mode.NE.0 .AND. abs( mode ).NE.6 ) .AND. cond.LT.
317 ELSE IF( kl.LT.0 )
THEN
319 ELSE IF( ku.LT.0 .OR. ( isym.NE.1 .AND. kl.NE.ku ) )
THEN
321 ELSE IF( ( order.LT.0 ) .OR. ( order.GT.n ) )
THEN
325 CALL pchk1mat( m, 1, n, 2, ia, ja, desca, 16, 0, idum1, idum2,
333 ELSE IF( ipack.NE.0 )
THEN
335 ELSE IF( kl.GT.0 .AND. kl.LT.m-1 )
THEN
337 ELSE IF( ku.GT.0 .AND. ku.LT.n-1 )
THEN
339 ELSE IF( llb.NE.0 .AND. llb.NE.m-1 )
THEN
343 CALL pxerbla( desca( ctxt_ ),
'PZLATMS', -info )
350 iseed( i ) = mod( abs( iseed( i ) ), 4096 )
353 IF( mod( iseed( 4 ), 2 ).NE.1 )
354 $ iseed( 4 ) = iseed( 4 ) + 1
360 CALL dlatm1( mode, cond, irsign, idist, iseed, d, mnmin, iinfo )
362 IF( iinfo.NE.0 )
THEN
368 IF( mode.NE.0 .AND. abs( mode ).NE.6 )
THEN
374 temp =
max( temp, abs( d( i ) ) )
377 IF( temp.GT.zero )
THEN
384 CALL dscal( mnmin, alpha, d, 1 )
388 CALL zlaset(
'A', np, nq, zzero, zzero, a, desca( lld_ ) )
392 CALL pzlaghe( m, llb, d, a, ia, ja, desca, iseed, order, work,
subroutine pzlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, ia, ja, desca, order, work, lwork, info)