121 parameter( two = 2.0e+0, one = 1.0e+0, zero = 0.0e+0 )
125 REAL BETA, BIGNUM, EPS, SAVEALPHA, SMLNUM, XNORM
128 REAL SLAMCH, SLAPY2, SNRM2
129 EXTERNAL slamch, slapy2, snrm2
144 eps = slamch(
'Precision' )
145 xnorm = snrm2( n-1, x, incx )
147 IF( xnorm.LE.eps*abs(alpha) )
THEN
151 IF( alpha.GE.zero )
THEN
161 x( 1 + (j-1)*incx ) = 0
169 beta = sign( slapy2( alpha, xnorm ), alpha )
170 smlnum = slamch(
'S' ) / slamch(
'E' )
172 IF( abs( beta ).LT.smlnum )
THEN
176 bignum = one / smlnum
179 CALL sscal( n-1, bignum, x, incx )
182 IF( (abs( beta ).LT.smlnum) .AND. (knt .LT. 20) )
187 xnorm = snrm2( n-1, x, incx )
188 beta = sign( slapy2( alpha, xnorm ), alpha )
192 IF( beta.LT.zero )
THEN
196 alpha = xnorm * (xnorm/alpha)
201 IF ( abs(tau).LE.smlnum )
THEN
210 IF( savealpha.GE.zero )
THEN
215 x( 1 + (j-1)*incx ) = 0
224 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