1 SUBROUTINE pslarfg( N, ALPHA, IAX, JAX, X, IX, JX, DESCX, INCX,
10 INTEGER IAX, INCX, IX, JAX, JX, N
145 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
146 $ lld_, mb_, m_, nb_, n_, rsrc_
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( one = 1.0e+0, zero = 0.0e+0 )
154 INTEGER ICTXT, IIAX, INDXTAU, IXCOL, IXROW, J, JJAX,
155 $ knt, mycol, myrow, npcol, nprow
156 REAL BETA, RSAFMN, SAFMIN, XNORM
159 EXTERNAL blacs_gridinfo,
infog2l, psnrm2, sgebr2d,
164 EXTERNAL slamch, slapy2
173 ictxt = descx( ctxt_ )
174 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
176 IF( incx.EQ.descx( m_ ) )
THEN
180 CALL infog2l( ix, jax, descx, nprow, npcol, myrow, mycol,
181 $ iiax, jjax, ixrow, ixcol )
188 IF( mycol.EQ.ixcol )
THEN
189 j = iiax+(jjax-1)*descx( lld_ )
190 CALL sgebs2d( ictxt,
'Rowwise',
' ', 1, 1, x( j ), 1 )
193 CALL sgebr2d( ictxt,
'Rowwise',
' ', 1, 1, alpha, 1,
203 CALL infog2l( iax, jx, descx, nprow, npcol, myrow, mycol,
204 $ iiax, jjax, ixrow, ixcol )
211 IF( myrow.EQ.ixrow )
THEN
212 j = iiax+(jjax-1)*descx( lld_ )
213 CALL sgebs2d( ictxt,
'Columnwise',
' ', 1, 1, x( j ), 1 )
216 CALL sgebr2d( ictxt,
'Columnwise',
' ', 1, 1, alpha, 1,
225 tau( indxtau ) = zero
229 CALL psnrm2( n-1, xnorm, x, ix, jx, descx, incx )
231 IF( xnorm.EQ.zero )
THEN
235 tau( indxtau ) = zero
241 beta = -sign( slapy2( alpha, xnorm ), alpha )
242 safmin = slamch(
'S' )
243 rsafmn = one / safmin
244 IF( abs( beta ).LT.safmin )
THEN
251 CALL psscal( n-1, rsafmn, x, ix, jx, descx, incx )
254 IF( abs( beta ).LT.safmin )
259 CALL psnrm2( n-1, xnorm, x, ix, jx, descx, incx )
260 beta = -sign( slapy2( alpha, xnorm ), alpha )
261 tau( indxtau ) = ( beta-alpha ) / beta
262 CALL psscal( n-1, one/(alpha-beta), x, ix, jx, descx, incx )
271 tau( indxtau ) = ( beta-alpha ) / beta
272 CALL psscal( n-1, one/(alpha-beta), x, ix, jx, descx, incx )