1 SUBROUTINE pdqrt13( SCALE, M, N, A, IA, JA, DESCA, NORMA, ISEED,
10 INTEGER IA, ISEED, JA, M, N, SCALE
11 DOUBLE PRECISION NORMA
15 DOUBLE PRECISION WORK( * )
16 DOUBLE PRECISION A( * )
130 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
131 $ lld_, mb_, m_, nb_, n_, rsrc_
132 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
133 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
134 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
136 parameter( one = 1.0d0 )
139 INTEGER I, IACOL, IAROW, ICOFFA, ICTXT, IIA, INFO,
140 $ iroffa, j, jja, mp, mycol, myrow, npcol,
142 DOUBLE PRECISION AJJ, ASUM, BIGNUM, SMLNUM
146 DOUBLE PRECISION PDLAMCH, PDLANGE
147 EXTERNAL numroc, pdlamch, pdlange
158 ictxt = desca( ctxt_ )
159 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
161 IF( m.LE.0 .OR. n.LE.0 )
166 iroffa = mod( ia-1, desca( mb_ ) )
167 icoffa = mod( ja-1, desca( nb_ ) )
168 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia,
169 $ jja, iarow, iacol )
170 mp = numroc( m+iroffa, desca( mb_ ), myrow, iarow, nprow )
171 nq = numroc( n+icoffa, desca( nb_ ), mycol, iacol, npcol )
177 CALL pdmatgen( ictxt,
'N',
'N', desca( m_ ), desca( n_ ),
178 $ desca( mb_ ), desca( nb_ ), a, desca( lld_ ),
179 $ desca( rsrc_ ), desca( csrc_ ), iseed, iia-1, mp,
180 $ jja-1, nq, myrow, mycol, nprow, npcol )
184 IF( i.LE.ia+m-1 )
THEN
185 CALL pdasum( m, asum, a, ia, j, desca, 1 )
186 CALL pdelget(
'Column',
' ', ajj, a, i, j, desca )
187 ajj = ajj + sign( asum, ajj )
188 CALL pdelset( a, i, j, desca, ajj )
194 IF( scale.NE.1 )
THEN
196 norma = pdlange(
'M', m, n, a, ia, ja, desca, work )
197 smlnum = pdlamch( ictxt,
'Safe minimum' )
198 bignum = one / smlnum
199 CALL pdlabad( ictxt, smlnum, bignum )
200 smlnum = smlnum / pdlamch( ictxt,
'Epsilon' )
201 bignum = one / smlnum
203 IF( scale.EQ.2 )
THEN
207 CALL pdlascl(
'General', norma, bignum, m, n, a, ia,
210 ELSE IF( scale.EQ.3 )
THEN
214 CALL pdlascl(
'General', norma, smlnum, m, n, a, ia,
221 norma = pdlange(
'One-norm', m, n, a, ia, ja, desca, work )