105 SUBROUTINE slarfg( N, ALPHA, X, INCX, TAU )
123 parameter( one = 1.0e+0, zero = 0.0e+0 )
127 REAL BETA, RSAFMN, SAFMIN, XNORM
130 REAL SLAMCH, SLAPY2, SNRM2
131 EXTERNAL slamch, slapy2, snrm2
146 xnorm = snrm2( n-1, x, incx )
148 IF( xnorm.EQ.zero )
THEN
157 beta = -sign( slapy2( alpha, xnorm ), alpha )
158 safmin = slamch(
'S' ) / slamch(
'E' )
160 IF( abs( beta ).LT.safmin )
THEN
164 rsafmn = one / safmin
167 CALL sscal( n-1, rsafmn, x, incx )
170 IF( (abs( beta ).LT.safmin) .AND. (knt .LT. 20) )
175 xnorm = snrm2( n-1, x, incx )
176 beta = -sign( slapy2( alpha, xnorm ), alpha )
178 tau = ( beta-alpha ) / beta
179 CALL sscal( n-1, one / ( alpha-beta ), x, incx )
subroutine slarfg(n, alpha, x, incx, tau)
SLARFG generates an elementary reflector (Householder matrix).
subroutine sscal(n, sa, sx, incx)
SSCAL