105 SUBROUTINE clarfg( N, ALPHA, X, INCX, TAU )
123 parameter( one = 1.0e+0, zero = 0.0e+0 )
127 REAL ALPHI, ALPHR, BETA, RSAFMN, SAFMIN, XNORM
130 REAL SCNRM2, SLAMCH, SLAPY3
132 EXTERNAL scnrm2, slamch, slapy3, cladiv
135 INTRINSIC abs, aimag, cmplx, real, sign
147 xnorm = scnrm2( n-1, x, incx )
148 alphr = real( alpha )
149 alphi = aimag( alpha )
151 IF( xnorm.EQ.zero .AND. alphi.EQ.zero )
THEN
160 beta = -sign( slapy3( alphr, alphi, xnorm ), alphr )
161 safmin = slamch(
'S' ) / slamch(
'E' )
162 rsafmn = one / safmin
165 IF( abs( beta ).LT.safmin )
THEN
171 CALL csscal( n-1, rsafmn, x, incx )
175 IF( (abs( beta ).LT.safmin) .AND. (knt .LT. 20) )
180 xnorm = scnrm2( n-1, x, incx )
181 alpha = cmplx( alphr, alphi )
182 beta = -sign( slapy3( alphr, alphi, xnorm ), alphr )
184 tau = cmplx( ( beta-alphr ) / beta, -alphi / beta )
185 alpha = cladiv( cmplx( one ), alpha-beta )
186 CALL cscal( n-1, alpha, x, incx )
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine cscal(n, ca, cx, incx)
CSCAL