105 SUBROUTINE dlarfg( N, ALPHA, X, INCX, TAU )
113 DOUBLE PRECISION ALPHA, TAU
116 DOUBLE PRECISION X( * )
122 DOUBLE PRECISION ONE, ZERO
123 parameter( one = 1.0d+0, zero = 0.0d+0 )
127 DOUBLE PRECISION BETA, RSAFMN, SAFMIN, XNORM
130 DOUBLE PRECISION DLAMCH, DLAPY2, DNRM2
131 EXTERNAL dlamch, dlapy2, dnrm2
146 xnorm = dnrm2( n-1, x, incx )
148 IF( xnorm.EQ.zero )
THEN
157 beta = -sign( dlapy2( alpha, xnorm ), alpha )
158 safmin = dlamch(
'S' ) / dlamch(
'E' )
160 IF( abs( beta ).LT.safmin )
THEN
164 rsafmn = one / safmin
167 CALL dscal( n-1, rsafmn, x, incx )
170 IF( (abs( beta ).LT.safmin) .AND. (knt .LT. 20) )
175 xnorm = dnrm2( n-1, x, incx )
176 beta = -sign( dlapy2( alpha, xnorm ), alpha )
178 tau = ( beta-alpha ) / beta
179 CALL dscal( n-1, one / ( alpha-beta ), x, incx )
subroutine dlarfg(n, alpha, x, incx, tau)
DLARFG generates an elementary reflector (Householder matrix).
subroutine dscal(n, da, dx, incx)
DSCAL