111 DOUBLE PRECISION ALPHA, TAU
114 DOUBLE PRECISION X( * )
120 DOUBLE PRECISION TWO, ONE, ZERO
121 parameter( two = 2.0d+0, one = 1.0d+0, zero = 0.0d+0 )
125 DOUBLE PRECISION BETA, BIGNUM, EPS, SAVEALPHA, SMLNUM, XNORM
128 DOUBLE PRECISION DLAMCH, DLAPY2, DNRM2
129 EXTERNAL dlamch, dlapy2, dnrm2
144 eps = dlamch(
'Precision' )
145 xnorm = dnrm2( 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( dlapy2( alpha, xnorm ), alpha )
170 smlnum = dlamch(
'S' ) / dlamch(
'E' )
172 IF( abs( beta ).LT.smlnum )
THEN
176 bignum = one / smlnum
179 CALL dscal( n-1, bignum, x, incx )
182 IF( (abs( beta ).LT.smlnum) .AND. (knt .LT. 20) )
187 xnorm = dnrm2( n-1, x, incx )
188 beta = sign( dlapy2( 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 dscal( n-1, one / alpha, x, incx )
subroutine dlarfgp(n, alpha, x, incx, tau)
DLARFGP generates an elementary reflector (Householder matrix) with non-negative beta.
subroutine dscal(n, da, dx, incx)
DSCAL