105 SUBROUTINE slarfgp( N, ALPHA, X, INCX, TAU )
124 parameter ( two = 2.0e+0, one = 1.0e+0, zero = 0.0e+0 )
128 REAL BETA, BIGNUM, SAVEALPHA, SMLNUM, XNORM
131 REAL SLAMCH, SLAPY2, SNRM2
132 EXTERNAL slamch, slapy2, snrm2
147 xnorm = snrm2( n-1, x, incx )
149 IF( xnorm.EQ.zero )
THEN
153 IF( alpha.GE.zero )
THEN
163 x( 1 + (j-1)*incx ) = 0
171 beta = sign( slapy2( alpha, xnorm ), alpha )
172 smlnum = slamch(
'S' ) / slamch(
'E' )
174 IF( abs( beta ).LT.smlnum )
THEN
178 bignum = one / smlnum
181 CALL sscal( n-1, bignum, x, incx )
184 IF( abs( beta ).LT.smlnum )
189 xnorm = snrm2( n-1, x, incx )
190 beta = sign( slapy2( alpha, xnorm ), alpha )
194 IF( beta.LT.zero )
THEN
198 alpha = xnorm * (xnorm/alpha)
203 IF ( abs(tau).LE.smlnum )
THEN
212 IF( savealpha.GE.zero )
THEN
217 x( 1 + (j-1)*incx ) = 0
226 CALL sscal( n-1, one / alpha, x, incx )
subroutine slarfgp(N, ALPHA, X, INCX, TAU)
SLARFGP generates an elementary reflector (Householder matrix) with non-negative beta.
subroutine sscal(N, SA, SX, INCX)
SSCAL