1 SUBROUTINE pzlassq( N, X, IX, JX, DESCX, INCX, SCALE, SUMSQ )
9 INTEGER IX, INCX, JX, N
10 DOUBLE PRECISION SCALE, SUMSQ
142 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
143 $ LLD_, MB_, M_, NB_, N_, RSRC_
144 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
145 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
146 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
147 DOUBLE PRECISION ZERO
148 parameter( zero = 0.0d+0 )
151 INTEGER I, ICOFF, ICTXT, IIX, IOFF, IROFF, IXCOL,
152 $ IXROW, JJX, LDX, MYCOL, MYROW, NP, NPCOL,
154 DOUBLE PRECISION TEMP1
157 DOUBLE PRECISION WORK( 2 )
167 INTRINSIC abs, dble, dimag, mod
173 ictxt = descx( ctxt_ )
174 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
178 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
182 IF( incx.EQ.descx( m_ ) )
THEN
188 icoff = mod( jx, descx( nb_ ) )
189 nq = numroc( n+icoff, descx( nb_ ), mycol, ixcol, npcol )
196 ioff = iix + ( jjx - 1 ) * ldx
198 IF( dble( x( ioff ) ).NE.zero )
THEN
199 temp1 = abs( dble( x( ioff ) ) )
200 IF( scale.LT.temp1 )
THEN
201 sumsq = 1 + sumsq * ( scale / temp1 )**2
204 sumsq = sumsq + ( temp1 / scale )**2
207 IF( dimag( x( ioff ) ).NE.zero )
THEN
208 temp1 = abs( dimag( x( ioff ) ) )
209 IF( scale.LT.temp1 )
THEN
210 sumsq = 1 + sumsq * ( scale / temp1 )**2
213 sumsq = sumsq + ( temp1 / scale )**2
225 CALL pdtreecomb( ictxt,
'Rowwise', 2, work, -1, ixcol,
231 ELSE IF( incx.EQ.1 )
THEN
237 iroff = mod( ix, descx( mb_ ) )
238 np = numroc( n+iroff, descx( mb_ ), myrow, ixrow, nprow )
245 ioff = iix + ( jjx - 1 ) * ldx
247 IF( dble( x( ioff ) ).NE.zero )
THEN
248 temp1 = abs( dble( x( ioff ) ) )
249 IF( scale.LT.temp1 )
THEN
250 sumsq = 1 + sumsq*( scale / temp1 )**2
253 sumsq = sumsq + ( temp1 / scale )**2
256 IF( dimag( x( ioff ) ).NE.zero )
THEN
257 temp1 = abs( dimag( x( ioff ) ) )
258 IF( scale.LT.temp1 )
THEN
259 sumsq = 1 + sumsq*( scale / temp1 )**2
262 sumsq = sumsq + ( temp1 / scale )**2
274 CALL pdtreecomb( ictxt,
'Columnwise', 2, work, -1, ixcol,